AnsweredAssumed Answered

app crashes if gps location is not in map

Question asked by hharoon on Dec 28, 2012
Latest reply on Jan 2, 2013 by hharoon
i try to enable gps and get this erro:

"Terminating app due to uncaught exception 'CALayerInvalidGeometry', reason: 'CALayer position contains NaN: [nan nan]'

This error is because my current location is not in the map i am loading. how do i fix my code to be able to catch this error and display a message?

here is my code for displaying gps location

if (!self.mapView.gps.enable)
[self.mapView.gps start];
[self.mapView.gps stop];