NSNumber * latitude = [NSNumber numberWithDouble:[[cityDictionary valueForKeyPath:@"coordinates.latitude"]doubleValue]];
NSNumber * longitude = [NSNumber numberWithDouble:[[cityDictionary valueForKeyPath:@"coordinates.longitude"]doubleValue]];
CLLocation *listingLocation = [[CLLocation alloc] initWithLatitude:latitude longitude:longitude];
我在上面的第 3 行收到以下错误:
Sending 'NSNumber *__strong' to parameter of incompatible type 'CLLocationDegrees' (aka 'double')
我知道这是因为我试图将 NSNumber 传递到它期望双倍的地方。但是由于ARC,铸造不起作用?