CLLocationCoordinate2DMake is new in iOS 4

I hadn’t done any Core Location work before iOS 4 came out. But now I am. And I ran into a very odd EXC_BAD_ACCESS bug when running on an iPod touch that’s running iPhone OS 3.1.3. I pinpointed the problem (actually, I think it was only a problem, because I did a lot of other refactoring to get to this point) was with CLLocationCoordinate2DMake. And I finally realised when looking in the header that it’s new for iOS 4. Which is why it fails under iPhone OS.

My fault for being a CL newbie.

In any case, I figure I should share this with others because my searches were fruitless. Enjoy!

UPDATE: The static inline function described by Cocoanetics was immensely helpful and also helped with the next problem I encountered – distanceFromLocation being introduced.

4 thoughts on “CLLocationCoordinate2DMake is new in iOS 4”

  1. I wasn’t getting “EXC_BAD_ACCESS”. Instead, I was getting “check_safe_call: could not restore current frame” and “unable to restore previously selected frame” warnings when debugging on iPhone running 3.1.3. Wished this page would’ve come up in my searches. Would have saved me a couple of hours. Thanks for the info!

  2. I spent about 6 hours looking into this problem. Hundreds of google searches. Finally, I found this. I’m just going to put a bunch of keywords in this comment in the hope that it’ll bring it up for other people.

    UIMapKit addAnnotation MKAnnotation bug check_safe_call: could not restore current frame ios 3

Comments are closed.