Re: NSMakeSize and correct type
Re: NSMakeSize and correct type
- Subject: Re: NSMakeSize and correct type
- From: Graham Cox <email@hidden>
- Date: Thu, 12 Mar 2009 23:23:04 +1100
On 12/03/2009, at 11:08 PM, Kevin Walzer wrote:
-(int) makeIcon: (NSString *) filePath imagewidth: (float *) width
imageheight: (float *)height outputfile:(NSString *)imagePath;
@end
@implementation MacIcon
-(int) makeIcon: (NSString *) filePath imagewidth: (float *) width
imageheight: (float*)height outputfile:(NSString *)imagePath {
float* means "pointer to float", so width and height are pointers....
[resizeicon setSize:NSMakeSize(width, height)];
...and NSMakeSize() does not want pointers, it wants the real thing,
<float>.
[resizeicon setPixelsWide:(int*) width];
[resizeicon setPixelsHigh:(int*)height];
This is also wrong. You are casting a "pointer to float" (float*) to a
"pointer to int" (int*). setPixelsWide: expects just an int.
You might be a bit confused about declaring pointer types in C, so
review your favourite reference on the topic.
The correction would probably be to simply get rid of the '*' for the
various float and int parameters.
--Graham
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden