Re: Accessing a managedObject property from within an accessor of another property
Re: Accessing a managedObject property from within an accessor of another property
- Subject: Re: Accessing a managedObject property from within an accessor of another property
- From: Brad Stone <email@hidden>
- Date: Tue, 22 Feb 2011 22:44:56 -0500
In my Note entity:
self = (Note *)0x20027bda0
In my .h file have this property defined: @property (nonatomic, retain) NSNumber * isFlagged; and this in .m @dynamic isFlagged; and no custom accessors
New code in my Note entity:
- (void)setIsEncrypted:(NSNumber *)value {
// see po #1 which I typed here
[self willChangeValueForKey:@"isFlagged"];
[self setPrimitiveValue:value forKey:@"isFlagged"];
[self didChangeValueForKey:@"isFlagged"];
// see po #2 which I typed here
[self willChangeValueForKey:@"isEncrypted"];
[self setPrimitiveValue:value forKey:@"isEncrypted"];
[self didChangeValueForKey:@"isEncrypted"];
// see po #3 which I typed here
}
po #1
po self
<Note> uid:319649395851582
category:None
isFlagged:0
isEncrypted:0
po #2
po self
<Note> uid:319649395851582
category:None
isFlagged:1
isEncrypted:0
po #3
po self
Breakpoint 28, -[SRMainWindowController toggleLock:] (self=0x2000df5e0, _cmd=0x1000a9239, sender=0x2000df5e0) at SRMainWindowController.m:2897
2897 [note setIsEncrypted:[NSNumber numberWithBool:YES]];
The program being debugged stopped while in a function called from GDB.
When the function (_NSPrintForDebugger) is done executing, GDB will silently
stop (instead of continuing to evaluate the expression containing
the function call).
Here's a backtrace right after po #3 before I'm out of setIsEncrypted
backtrace
#0 -[SRMainWindowController toggleLock:] (self=0x2000df5e0, _cmd=0x1000a9239, sender=0x2000df5e0) at SRMainWindowController.m:2897
#1 0x000000010002dae9 in -[SRMainWindowController getEncryptionKey] (self=0x2000df5e0, _cmd=0x1000a7210) at SRMainWindowController.m:2948
#2 0x00000001000098d2 in -[Note category] (self=0x20027bda0, _cmd=0x7fff85450184) at Note.m:257
#3 0x00000001000089c8 in -[Note description] (self=0x20027bda0, _cmd=0x7fff83c821e8) at Note.m:56
#4 0x00007fff868a386b in _NSPrintForDebugger ()
#5 <function called from gdb>
#6 -[Note setIsEncrypted:] (self=0x20027bda0, _cmd=0x1000a6eb8, value=0x7fff70886280) at Note.m:206
#7 0x000000010002d5c9 in -[SRMainWindowController toggleLock:] (self=0x2000df5e0, _cmd=0x1000a9239, sender=0x2000867e0) at SRMainWindowController.m:2897
#8 0x00007fff83b2afbf in -[NSToolbarButton sendAction:to:] ()
#9 0x00007fff8379c135 in -[NSToolbarItemViewer mouseDown:] ()
#10 0x00007fff8368934f in -[NSWindow sendEvent:] ()
#11 0x00007fff835bea86 in -[NSApplication sendEvent:] ()
#12 0x00007fff835554da in -[NSApplication run] ()
#13 0x00007fff8354e1a8 in NSApplicationMain ()
#14 0x0000000100006b60 in main (argc=1, argv=0x7fff5fbff628) at main.m:13_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden