Re: How to make KVO setup persistent?
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