Re: Encoding / Decoding CGPoint with NSCoder

2009-01-15 Thread Kyle Sluder
On Thu, Jan 15, 2009 at 5:21 PM, Nick Zitzmann wrote: > In addition to what everyone else has already said, if you're using the > Leopard or later SDK, you can also add NS_BUILD_32_LIKE_64 to your target's > preprocessor definitions. Then CGPoint and NSPoint will be exactly the same, > and you can

Re: Encoding / Decoding CGPoint with NSCoder

2009-01-15 Thread Nick Zitzmann
On Jan 15, 2009, at 12:38 PM, Mike Chambers wrote: Does anyone have a simple example of how to encode and decode a CGPoint struct using NSCoder? In addition to what everyone else has already said, if you're using the Leopard or later SDK, you can also add NS_BUILD_32_LIKE_64 to your targ

Re: Encoding / Decoding CGPoint with NSCoder

2009-01-15 Thread Sean McBride
On 1/15/09 2:33 PM, glenn andreas said: >[aCoder encodeCGPoint: cgPoint forKey: @"Key"]; > > >cgPoint = [aDecoder decodeCGPointForKey: @"Key"]; Seems those are iPhone-only methods. -- Sean McBride, B. Eng s...@rogue-res

Re: Encoding / Decoding CGPoint with NSCoder

2009-01-15 Thread glenn andreas
On Jan 15, 2009, at 2:36 PM, David Duncan wrote: On Jan 15, 2009, at 11:38 AM, Mike Chambers wrote: Does anyone have a simple example of how to encode and decode a CGPoint struct using NSCoder? You can always use NSValue's +valueWithPoint:. You will have to convert to NSPoint (which is v

Re: Encoding / Decoding CGPoint with NSCoder

2009-01-15 Thread David Duncan
On Jan 15, 2009, at 11:38 AM, Mike Chambers wrote: Does anyone have a simple example of how to encode and decode a CGPoint struct using NSCoder? You can always use NSValue's +valueWithPoint:. You will have to convert to NSPoint (which is virtually a no-op) via NSPointFromCGPoint(). -- Da

Re: Encoding / Decoding CGPoint with NSCoder

2009-01-15 Thread glenn andreas
On Jan 15, 2009, at 1:38 PM, Mike Chambers wrote: I am using NSCoder to encode my class. This is working fine, but I am having trouble figuring out how to encode CGPoint. I have searched online, but have found some conflicting information, and as I am relatively new to Objective-C, I am having

Re: Encoding / Decoding CGPoint with NSCoder

2009-01-15 Thread Dave DeLong
-encodeWithCoder: [encoder encodeFloat:myPoint.x forKey:@"myPoint.x"]; [encoder encodeFloat:myPoint.y forKey:@"myPoint.y"]; -initWithCoder: myPoint = CGPointMake([decoder decodeFloatForKey:@"myPoint.x"], [decoder decodeFloatForKey:@"myPoint.y"]); HTH, Dave On Jan 15, 2009, at 12:38 PM, Mike

Encoding / Decoding CGPoint with NSCoder

2009-01-15 Thread Mike Chambers
I am using NSCoder to encode my class. This is working fine, but I am having trouble figuring out how to encode CGPoint. I have searched online, but have found some conflicting information, and as I am relatively new to Objective-C, I am having trouble figuring it out. Does anyone have a simple ex