• 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
[SOLVED]: Using NSObjCMessageLoggingEnabled, how?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[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
References: 
 >Using NSObjCMessageLoggingEnabled, how? (From: Ken Tozier <email@hidden>)
 >Re: Using NSObjCMessageLoggingEnabled, how? (From: email@hidden)
 >Re: Using NSObjCMessageLoggingEnabled, how? (From: Ken Tozier <email@hidden>)
 >Re: Using NSObjCMessageLoggingEnabled, how? (From: "Jonathan del Strother" <email@hidden>)
 >Re: Using NSObjCMessageLoggingEnabled, how? (From: Ken Tozier <email@hidden>)
 >Re: Using NSObjCMessageLoggingEnabled, how? (From: Jens Alfke <email@hidden>)

  • Prev by Date: Re: Permissions in Interface Builder
  • Next by Date: jump to definition broken for frameworks only
  • Previous by thread: Re: Using NSObjCMessageLoggingEnabled, how?
  • Next by thread: Re: Using NSObjCMessageLoggingEnabled, how?
  • Index(es):
    • Date
    • Thread