• 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: What to use observeValueForKeyPath: context
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: What to use observeValueForKeyPath: context


  • Subject: Re: What to use observeValueForKeyPath: context
  • From: Dave Dribin <email@hidden>
  • Date: Fri, 29 Aug 2008 13:36:28 -0500

On Aug 29, 2008, at 12:35 PM, Dave Dribin wrote:
On Aug 29, 2008, at 12:23 PM, j o a r wrote:
The penalty for using constant strings is that they will end up wasting space in your binary...
Rons suggestion is probably optimal.

I'm definitely leaning towards that way, now. Though I may combine both for debugging.


static NSString *PropertyObservationContext = @"Property Context";

Use &PropertyObservationContext as the context. This way you could "po *(id *)context" in gdb for a human readable context.

I've filed rdar://problem/6185473 to update the "Key-Value Observing Programming Guide" about proper use of the context. The doc doesn't even use the context at all.


-Dave

_______________________________________________

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


References: 
 >What to use observeValueForKeyPath: context (From: Dave Dribin <email@hidden>)
 >Re: What to use observeValueForKeyPath: context (From: "Michael Ash" <email@hidden>)
 >Re: What to use observeValueForKeyPath: context (From: Dave Dribin <email@hidden>)
 >Re: What to use observeValueForKeyPath: context (From: "Michael Ash" <email@hidden>)
 >Re: What to use observeValueForKeyPath: context (From: j o a r <email@hidden>)
 >Re: What to use observeValueForKeyPath: context (From: Dave Dribin <email@hidden>)

  • Prev by Date: Convert unicode string into ascii
  • Next by Date: Re: What to use observeValueForKeyPath: context
  • Previous by thread: Re: What to use observeValueForKeyPath: context
  • Next by thread: Re: What to use observeValueForKeyPath: context
  • Index(es):
    • Date
    • Thread