• 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: How to make KVO setup persistent?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to make KVO setup persistent?


  • Subject: Re: How to make KVO setup persistent?
  • From: "Arthur C." <email@hidden>
  • Date: Wed, 26 Jul 2006 22:51:43 +0200


Briefly looking through the archives, it looks like you might be able to just re-setup the KVO in awakeFromFetch:
http://www.cocoabuilder.com/archive/message/cocoa/2006/2/21/157227

My latest attempt involves using awakeFromFetch (Person) in which the Age's are fetched using a fetchRequest.


-(void) awakeFromFetch
{
// fragment of code
Age * Age = [[[Age alloc] init] autorelease];
myAge = [fetchResults objectAtIndex: 0];
[myAge index];
[self addObserver: myAge forKeyPath:@"geboortejaar" options: NSKeyValueObservingOptionNew context:managedObjectContext];
}


It still does not work, sometimes it crashes. The point is that the Age's get released / dealloced after this method has been called... The 'autorelease' looks no good, but I don't know what else should be done.

Any suggestions?

Arthur C.

Another thought I had was instead of KVO, you could possibly set the Age relationship as a dependent key of the birth year, though I'm not sure that dependent keys work with relationships.

Those are all semi-guesses on my part, but hopefully one will turn into a real solution for you.

George

_________________________________________________________________ MSN Search, for accurate results! http://search.msn.nl

_______________________________________________
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


References: 
 >Re: How to make KVO setup persistent? (From: George Orthwein <email@hidden>)

  • Prev by Date: Re: NSTextView, style, and weird Core Data issue
  • Next by Date: Fwd: NSString** in scanners
  • Previous by thread: Re: How to make KVO setup persistent?
  • Next by thread: Re: How to make KVO setup persistent?
  • Index(es):
    • Date
    • Thread