[SOLVED]: Using NSObjCMessageLoggingEnabled, how?
[SOLVED]: Using NSObjCMessageLoggingEnabled, how?
- Subject: [SOLVED]: Using NSObjCMessageLoggingEnabled, how?
- From: Ken Tozier <email@hidden>
- Date: Mon, 2 Jun 2008 16:45:43 -0400
Thanks all
I found an easy way to target object registration, that might be of
some use to others in the same boat, by writing a custom
"addObserver" method to the classin question.
- (void) addObserver:(id) inObserver
forKeyPath:(NSString *) inPath
options:(NSKeyValueObservingOptions) inOptions
context:(void *) inContext
{
NSLog(@"page: %@ adding observer: %@ forKeyPath: %@", pageNumber,
inObserver, inPath);
[super addObserver: inObserver
forKeyPath: inPath
options: inOptions
context: inContext];
}
This allows you to be as specific as you want in figuring out what is
registering with your classes.
Ken
On Jun 2, 2008, at 10:37 AM, Jens Alfke wrote:
On 2 Jun '08, at 3:31 AM, Ken Tozier wrote:
I've already tried to track down this bug by putting NSLogs
immediately before and after everything that sets the property in
question but I'm still getting double calls to
"observeValueForKeyPath" for single calls to "setPageNumber."
There seems to be something going on "under the hood" that's
causing this double invocation.
So set a breakpoint in your observer method, and look at what's on
the stack. (Add Quark as a "custom executable", as someone already
described, then run with breakpoints enabled.)
—Jens
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden