magicalpanda / MagicalRecord

Super Awesome Easy Fetching for Core Data!
Other
10.8k stars 1.79k forks source link

Getting duplicates values using Magical Record 3.0. #1296

Open deepakdhanaie opened 7 years ago

deepakdhanaie commented 7 years ago

I'm using MR 3.0 and importing the objects giving me duplicates.It was working fine in MR 2.3 but when i upgraded to MR 3.0 every time i get duplicates for already saved objects.

    MagicalRecord.saveWithBlock({ (localContext) in

        if let recipeArray = responseDict["recipes"] as? [[String : AnyObject]]{

            for  responseDict in recipeArray {
             Recipe.MR_importFromObject(badgesRecipeDict, inContext: localContext) as! Recipe

        }

        }) { (contextDidSave , error) -> Void in

            if(contextDidSave){   
            }
            else{

            }

    }

I have used relatedByAttribute key in userInfo in Database Schema as well and I'm not able to find the solution for this.