I am not sure why I am getting the following error:

the height doesn’t complain anything, it’s just the width… why?
Here’s my code:
@interface Embed : RKObject {
NSString * _url;
NSString * _original;
NSNumber * _width;
NSNumber * _height;
}
@property (nonatomic, retain) NSString * url;
@property (nonatomic, retain) NSString * original;
@property (nonatomic, retain) NSNumber * width;
@property (nonatomic, retain) NSNumber * height;
@end
@implementation Embed
@synthesize url = _url;
@synthesize original = _original;
@synthesize width = _width;
@synthesize height = _height;
+ (NSDictionary*) elementToPropertyMappings {
return [NSDictionary dictionaryWithKeysAndObjects:
@"url", @"url",
@"original", @"original",
@"width", @"width",
@"height", @"height",
nil];
}
- (void)dealloc
{
[_url release];
[_original release];
[_width release];
[_height release];
[super dealloc];
}
@end
not sure why it’s a CGFloat, never convert it to CGFloat anywhere else
The error message would imply that it thinks the ‘width’ message, as posted to the
objectAtIndex:0returns aCGFloat, not anNSNumber.It’s possible it has made an incorrect guess about the thing you’re calling width on, so assuming you have your object defined correctly you probably just need to give the compiler the correct hint, e.g. (broken down to make it clear where the cast goes):