On Mar 27, 2008, at 10:29 AM, Clark Cox wrote:
On Wed, Mar 26, 2008 at 4:04 PM, Lorenzo <[EMAIL PROTECTED]> wrote:
Hi Laurent,
I am going to debug and let you know. Right now I have found these lines.
Might they cause the trouble on Leopard && PPC?


No, but this line will cause problems when/if you build for 64-bit:
number = CFNumberCreate(NULL, kCFNumberFloatType, &destSize.width);

Use kCFNumberCGFloatType instead of kCFNumberFloatType, and make sure
that you later CFRelease(number). Or just use NSNumber.

You could just use NSNumber, if it were not for the fact that NSNumber doesn't have any API support for CGFloat. :-)

 (rdar: //5812091)

You can add it with a category:

@implementation NSNumber (CGFloatSupport)

+ (NSNumber *) numberWithCGFloat: (CGFloat) cgFloatValue
{
CFNumberRef cfVersion = CFNumberCreate(NULL, kCFNumberCGFloatType, &cgFloatValue);
        return [NSMakeCollectable(cfVersion) autorelease];
}

- (CGFloat) cgFloatValue
{
        CGFloat retVal = 0;

        CFNumberGetValue((CFNumberRef) self, kCFNumberCGFloatType, &retVal);

        return retVal;
}
@end
_______________________________________________

Cocoa-dev mailing list ([email protected])

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to