• 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
CGPoint and KVO
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

CGPoint and KVO


  • Subject: CGPoint and KVO
  • From: Roland King <email@hidden>
  • Date: Sat, 3 Apr 2010 22:40:23 +0800

I have a property which is a CGPoint and I'm observing it. I didn't really know what to expect in the change dictionary (I have NSKeyValueObservingOld as the observation flags) so I stuck in a breakpoint and went looking. After messing about in the debugger when the property was changed I found the old value was an NSConcreteValue and the following code appears to work to extract the CGPoint from it

	CGPoint oldPoint;
	id oldValue = [ change valueForKey:NSKeyValueChangeOld ];
	[ (NSValue*)oldValue getValue:&oldPoint ]

Is this correct? I've failed to find anything much in the KVO documentation about CGPoint or how I should expect to receive structs or other primitives.

This is iPhone OS (incase that makes a difference). _______________________________________________

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

  • Follow-Ups:
    • Re: CGPoint and KVO
      • From: Kiel Gillard <email@hidden>
  • Prev by Date: Re: iPhone CoreData TableView not updating (solved)
  • Next by Date: Re: CGPoint and KVO
  • Previous by thread: NSXMLElement and namespaces
  • Next by thread: Re: CGPoint and KVO
  • Index(es):
    • Date
    • Thread