cocoa - Disappearing NSManagedObjects -


i working on document based application.

when opening saved file, load in nsmanagedobjectcontext view controller. view controller needs observe changed on property "depth" on objects of type. when view controller gets context, gets these objects, adds observer of value on each, , keeps them in array keep track.

whenever core data sends contextdidchange notification, add created objects array after observing them. deleted objects, remove view controller observer , remove them array.

this works great until close document , reopen it. when happens, objects added array. observation works fine. however, second first "nsmanagedobjectcontextobjectsdidchangenotification" comes in, of nsmanagedobjects somehow no longer in array set up. on delete, crash telling me can't remove observer that's not observer.

it's strange.

why nsmanagedobjets gone? don't release array or funny business @ all.

when close document , reopen it, getting new view controller object.
however, sounds original view controller still around , still observing:

nsmanagedobjectcontextobjectsdidchangenotification. 

check make sure when close document view controller removing notification observer.


Comments

Popular posts from this blog

c# - how to write client side events functions for the combobox items -

exception - Python, pyPdf OCR error: pyPdf.utils.PdfReadError: EOF marker not found -