Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS simulator cannot get custom location when debugging

After updating to Xcode 5.0.2, it seems that iOS simulator custom location option is not working propertly. When I prompt this

Custom location in iOS simulator 7.0.3

And reopen again the custom location dialog

Custom location failure in iOS simulator 7.0.3

I end getting the lat/lon values without decimals. Also, if I prompt a . instead of a comma, some times the dialog replaces the point with a comma, and sometimes deletes the decimal values. I've tried closing the simulator, changing hardware and restarting Xcode with no results.

like image 328
amb Avatar asked Nov 15 '13 12:11

amb


2 Answers

There is a bug in the modal "Custom Location" window of iOS Simulator that affects users who have the comma set as the decimal number separator.

If you type the coordinates with the format XX,XX and you press OK, the numbers after the comma are truncated.

Try inputing both coordinates with the format XX.XXX ( 2 digits + a point (.) + 3 digits) then press OK, then quit the iOS Simulator. When you launch it again, it'll have the desired location.

If you go to the same "Custom location" windows you are going to visualize the coordinates in format XX,XX, but DO NOT PRESS OK in that windows, just press Cancel, because if you press OK they will be truncated again.

like image 136
alvaro Avatar answered Oct 02 '22 21:10

alvaro


You can use this Macro #if (TARGET_IPHONE_SIMULATOR) and manually set a custom location in your code.

Hope it helps

like image 40
bs7 Avatar answered Oct 02 '22 19:10

bs7