iphone - CoreData the save method is not working -


I am creating an app using coredata for my iPhone

There is a visual controller with the object that I want to save that object to my favorite ViewController. By clicking on the Favorites button I want to save my object in managed objectText, but I am getting the following error:

End the app due to an incomplete exception 'NSInternalInconsistencyException', Reason: 'Trying to do another operation with a fetch already in progress' *

My code:

  // Step 1: Favorite the object * NewFavorite = (favorite *) [NSEntityDescription insertNewObjectForEntityForName: @Popularity SFTP Dropbox Account object Contaks: managedObjectContext]; // Step 2: Set properties newFavorite.name = @ "Company"; NSLog (@ "% @", newFavorite); // Step 3: Save Item NSError * Error = Zero; If (! [Newfavorite.managedObjectContext save: & amp; error]) {// This is where the program crash NSLog (@ "Unsolved error% @,% @", error, [error user information]); Abortion (); }  

I'm not sure what I'm doing wrong

I'm guessing that you have a UI element, such as table, which activates a fetch The UI turns. For example, if you have a controller with no result, then any result of any scrolling in the table can be achieved by the controller's fetch.

You can not change a collection by going through that collection, because the journey is in progress, while the repetition is in the process. An object is repeated on the collection of objects that match its existence and ingenuity. If Fetch is working, then if you include something, then you will get an error.

Normally you see this problem with many threads but I think the UI can set the problem in the right circumstances


Comments

Popular posts from this blog

c# - sqlDecimal to decimal clr stored procedure Unable to cast object of type 'System.Data.SqlTypes.SqlDecimal' to type 'System.IConvertible' -

Calling GetGUIThreadInfo from Outlook VBA -

Obfuscating Python code? -