• 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: addObserver confusion [SOLVED]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: addObserver confusion [SOLVED]


  • Subject: Re: addObserver confusion [SOLVED]
  • From: Ken Tozier <email@hidden>
  • Date: Wed, 31 Jan 2007 16:09:23 -0500

I'm putting the obsered changes into an NSInvocation and it turns out I was passing the object rather than the object address.



Turns out the problem was that I wasn't passing
On Jan 31, 2007, at 3:44 PM, Ken Tozier wrote:

Hi

I'm setting up some observers for an object's properties to watch for and return NSKeyValueObservingOptionOld NSKeyValueObservingOptionNew but am having trouble determining the type of the resultant values in my observeValueForKeyPath method.

The observed properties are BOOLs but I have no idea what I'm being passed. Here's what I've tried

// this prints to the run log fine which led me to believe the returned values were objects.
NSLog(@"Observed changes: old value: %@, new value: %@", [inChange objectForKey: NSKeyValueChangeOldKey], [inChange objectForKey: NSKeyValueChangeNewKey]);


Next I tried this to see if I could figure out the class
NSLog(@" new value type = ", NSStringFromClass([[inChange objectForKey: NSKeyValueChangeNewKey] class]));


Which prints as the very helpful line
new value type =

So what exactly does observeValueForKeyPath return?

TIA

Ken







_______________________________________________

Cocoa-dev mailing list (email@hidden)

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:
40comcast.net


This email sent to email@hidden

_______________________________________________

Cocoa-dev mailing list (email@hidden)

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: 
 >addObserver confusion (From: Ken Tozier <email@hidden>)

  • Prev by Date: addObserver confusion
  • Next by Date: Re: Best way to determine if a path is a directory?
  • Previous by thread: addObserver confusion
  • Next by thread: Releasing WebView
  • Index(es):
    • Date
    • Thread