Oh, I see. You're creating a MOC just for this method and never merging it with the context you're using outside the scope of the method, so your changes after insertion go unsaved. I bet a number of people just skimmed right passed that because the whole MOC entityname/insert junk is always so verbose.
With methods of my own similar to your createUserForLoginWithFacebookToken:
, I pass in the MOC that I'm using as an additional method parameter of NSManagedObjectContext*
type. I wouldn't allocate a whole new MOC, insert one object into it, and then merge. In general, there's one MOC per thread.