FROM : Arthur C.
DATE : Wed Jul 26 22:51:43 2006
>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
DATE : Wed Jul 26 22:51:43 2006
>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
| Related mails | Author | Date |
|---|---|---|
| Arthur C. | Jul 20, 18:13 | |
| Arthur C. | Jul 20, 18:14 | |
| Arthur C. | Jul 21, 11:21 | |
| George Orthwein | Jul 21, 16:29 | |
| Arthur C. | Jul 26, 22:51 |






Cocoa mail archive

