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
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
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
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
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
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
-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
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