I read about SO and did Google it honestly, but I could not find the answer to my problem ...
I have an NSDictionary that returns NSCFString's , and I need an NSString so that I can use its doubleValue function. I cannot understand for life how to turn my NSCFString into NSString s. I tried the following without success:
NSString* lng_coord = (NSString*)[dict objectForKey:key]; if ([lng_coord class] == [NSString class]) NSLog(@"lng coord is an exact match with NSString class"); else { NSLog(@"lng coord doesn't match NSString class"); NSLog(@"The class of lng_coord is %@", [[dict objectForKey:key] class]); } NSLog(@"%@", lng_coord); [CelebsAnnotation setLongitude:[lng_coord doubleValue]];
And this is the console output:
lng coord doesn't match NSString class The class of lng_coord is NSCFString 49.2796758
source share