I have an array of objects that are positioned using CGPoints . At certain times in my app, an object in the array needs to notify other non-arrayed objects of its position. I understand that NSNotification is the best way to go, but I cant find a decent example of a ‘sender’ and ‘reciever’ for the notification that wraps and unwraps a CGPoint as userinfo. Can anyone help?
Share
In Cocoa Touch (but not Cocoa), CGPoints can be wrapped and unwrapped with
NSValues can be stored in the NSDictionary passed as the userinfo parameter.
For example:
And in your notification: