• 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: CoreData - re-faulting object and removing self-observers results in messages being sent to zombie
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: CoreData - re-faulting object and removing self-observers results in messages being sent to zombie


  • Subject: Re: CoreData - re-faulting object and removing self-observers results in messages being sent to zombie
  • From: Jim Correia <email@hidden>
  • Date: Wed, 3 Aug 2005 21:29:08 -0400

On Aug 3, 2005, at 5:31 PM, Frank Illenberger wrote:

1. willChangeValueForKey/didChangeValueForKey are only called when there is actually some object obeserving the key. This is an optimization new to Tiger. In Panther, these methods were called even when there was no one observing. So this is not a good place to hook in.

Frank,

Is this documented someplace? Is it true even for subclasses of NSManagedObject?

If I take my previous example, add a magicString string attribute to Person, and implement person like this

@implementation Person

- (void)awakeFromInsert
{
    [super awakeFromInsert];

NSManagedObject *resume = [NSEntityDescription insertNewObjectForEntityForName: @"Resume" inManagedObjectContext: [self managedObjectContext]];

    [self setValue: resume forKey: @"resume"];
    [self setValue: @"some value" forKey: @"magicAttribute"];
}

- (void)didChangeValueForKey:(NSString *)key
{
    [super didChangeValueForKey: key];
    NSLog(@"didChangeValueForKey - key = %@", key);
}

@end

didChangeValueForKey is called for magicAttribute even though there are no observers (or UI objects bound to that key.)

Jim
_______________________________________________
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: CoreData - re-faulting object and removing self-observers results in messages being sent to zombie
      • From: Melissa Turner <email@hidden>
    • Re: CoreData - re-faulting object and removing self-observers results in messages being sent to zombie
      • From: Jim Correia <email@hidden>
References: 
 >Re: CoreData - re-faulting object and removing self-observers results in messages being sent to zombie (From: Frank Illenberger <email@hidden>)

  • Prev by Date: core data document undo problem
  • Next by Date: Re: NSImage or NSBezierPath : what is the fastest ?
  • Previous by thread: Re: CoreData - re-faulting object and removing self-observers results in messages being sent to zombie
  • Next by thread: Re: CoreData - re-faulting object and removing self-observers results in messages being sent to zombie
  • Index(es):
    • Date
    • Thread