• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Best time to add observers for managed object?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Best time to add observers for managed object?


  • Subject: Re: Best time to add observers for managed object?
  • From: Charilaos Skiadas <email@hidden>
  • Date: Sun, 10 Jul 2005 02:27:54 -0500


On Jul 10, 2005, at 2:14 AM, mmalcolm crawford wrote:


On Jul 10, 2005, at 12:01 AM, Charilaos Skiadas wrote:


I tried to add my observer at awakeFromInsert, and it works for newly created objects, but when I load a saved document, awakeFromInsert does not get called for the objects that where stored in the document.
Is there a better place to insert the observer? Would I actually have to override the designated initializer?




What are you wanting to observe? It may be appropriate to either override the initialiser, or to override both awakeFromInsert and awakeFromFetch (and probably invoke a common method from the two).

I have an Entity called GradeType, with a boolean attribute called isLetter. In my UI I have a popup button, which I want to populate with the gradeType objects that have isLetter false.
To do that, I set up method numericGradeTypes in my MyDocument class, which uses a fetch request to return an array of these objects (actually, it returns an array of the attributes "name" of these objects). Then I bound the contentValues of the popup to File's owner (MyDocument), with keypath "numericGradeTypes". This work and populates the popup with the right stuff.
Problem is now, that I need somehow to observe changes in isLetter, so I thought what I should do is have my current document observe each GradeType object for changes to their isLetter attribute. That's what I am doing now in the awakeFromInsert call. But this seems to miss the objects that are loaded from a saved document.


I hope the above was not too confusing.
Is there a better way to go about it?
mmalc


thanks, Haris


_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
  • Follow-Ups:
    • Re: Best time to add observers for managed object?
      • From: mmalcolm crawford <email@hidden>
References: 
 >Best time to add observers for managed object? (From: Charilaos Skiadas <email@hidden>)
 >Re: Best time to add observers for managed object? (From: mmalcolm crawford <email@hidden>)

  • Prev by Date: Re: Best time to add observers for managed object?
  • Next by Date: Re: "untitled" vs "Untitled"
  • Previous by thread: Re: Best time to add observers for managed object?
  • Next by thread: Re: Best time to add observers for managed object?
  • Index(es):
    • Date
    • Thread