In Cocoa Touch (but not Cocoa), CGPoints can be wrapped and expanded using
+ (NSValue *)valueWithCGPoint:(CGPoint)point - (CGPoint)CGPointValue
NSValues ββcan be stored in the NSDictionary passed as the userinfo parameter.
For example:
NSValue* value = [NSValue valueWithCGPoint:mypoint]; NSDictionary* dict = [NSDictionary dictionaryWithObject:value forKey:@"mypoint"];
And in your notice:
NSValue* value = [dict objectForKey:@"mypoint"]; CGPoint newpoint = [value CGPointValue];
Peter N Lewis
source share