iphone - What is the difference between self.managedObjectContext and managedObjectInstance.managedObjectContext? -


so, have coredata entities book, bookmark, highlight. book contains information book , nsset of bookmarks.

i want delete bookmarks present in 1 book , repopulate them set.

this code have got project , can not seem why have used different kinds of deleteobject method.

they go like:

for (bookmark *bookmark in book.bookmarks) {     [bookmark.mamagedobjectcontext deleteobject:bookmark]; } 

what's difference between using self.managedobjectcontext , bookmark.managedobjectcontext. also, either doesn't seem have effect on contents , error while trying delete bookmarks in forin loop , adding new set forin loop again.

please mention in comments if more information required.

the managedobjectinstance.managedobjectcontext returns managed object context receiver registered.

in other words, if created, example, bookmark in main thread context (the 1 associated context created in main thread), bookmark.managedobjectcontext point that.

are using different threads? different contexts? type of error have? share adding edit question.


Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Socket.connect doesn't throw exception in Android -

iphone - How do I keep MDScrollView from truncating my row headers and making my cells look bad? -