I am having problems trying to pass a double value number to another viewController.
This is the NSNumber declaration on the receiving viewController:
@property (nonatomic, assign) NSNumber *lat;
And this is how am I getting the value from the source viewController:
double lat1 = [[[categorias objectAtIndex:i]objectForKey:@"latitud"] doubleValue];
double lon1 = [[[categorias objectAtIndex:i]objectForKey:@"longitud"] doubleValue];
annotation3.lat = [NSNumber numberWithDouble:lat1];
annotation3.lon = [NSNumber numberWithDouble:lon1];
NSLog(@"ANNOTATION LAT %@",annotation3.lat);//Log OK
NSLog(@"ANNOTAION LON %@",annotation3.lon);//Log OK
And then on another method, where I try to pass the value lat to the other viewController:
myAnnotation *ann = (myAnnotation *)view.annotation;
detailViewController.lat = ann.lat;
How should I format 'ann.lat'? I have tried
ann.lat
[ann.lat doubleValue]
[NSNumber numberWithDouble:ann.lat]
And always getting error.