Hey all,
xcode is complaining that I am passing an element with id type as a parameter to a getter/setter method which was declared as a float. Its true it was declared with float:
But here's what throws me off. The return value of [rep objectForKey
"latitude"] and [rep objectForKey
"longitude"] are both floats:
So since its passing a float to the latitude and longitude methods, why does it tell me that its passing an id?
thanks for response
xcode is complaining that I am passing an element with id type as a parameter to a getter/setter method which was declared as a float. Its true it was declared with float:
Code:
@interface Report : NSObject
{
@private
NSNumber *speed;
float latitude;
float longitude;
}
@property (strong, nonatomic) NSNumber *speed;
@property float latitude;
@property float longitude;
//report.m
@synthesize speed = _speed;
@synthesize latitude;
@synthesize longitude;
But here's what throws me off. The return value of [rep objectForKey
Code:
for (NSDictionary *dict in resultsDictionary) {
NSDictionary *rep = [dict objectForKey:@"report"];
if(rep){
Report *report = [[Report alloc] init];
report.speed = [rep objectForKey:@"speed"];
report.latitude = [rep objectForKey:@"latitude"];
report.longitude = [rep objectForKey:@"longitude"];
So since its passing a float to the latitude and longitude methods, why does it tell me that its passing an id?
thanks for response