converting a CLLocationCoordinate2D type to number or string

无人久伴 提交于 2019-12-03 16:43:54

You haven't mentioned what the warning is but it's most likely because you forgot the @ in front of the NSLog strings:

NSLog(@"User's latitude is: %f", self.locModel.userLocation.coordinate.latitude );
NSLog(@"User's longitude is: %f", self.locModel.userLocation.coordinate.longitude );

Your updated code should be:

NSLog(@"User's latitude is: %@", tmpLat);
NSLog(@"User's longitude is: %@", tmpLong);

NSLog expects an NSString parameter which needs an @ sign in front. Without the @ sign, the string is a plain C string not an NSString object.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!