Error : Assigning to 'CLLocationCoordinate2D' from incompatible type 'id'

允我心安 提交于 2019-12-04 17:21:45

As CLLocationCoordinate2D is not an Objective-C object, but a struct, it cannot be directly stored in an NSArray object, but rather it must be wrapped within an NSValue object.

Therefore the code to read co-ordinates from the array is probably:

CLLocationCoordinate2D coords;
[[coordinates objectAtIndex:i] getValue:&coords];
point.coordinate = coords;

However to know for sure, I would need to see how the array was created.

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