5

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.

1
  • 1
    I have this problem too, please post an answer if you find a solution to this. Commented Dec 26, 2013 at 14:34

4 Answers 4

10

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.

Sign up to request clarification or add additional context in comments.

1 Comment

Bottom line - Restart the Simulator to get the updated custom domain.
2

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

Hope it helps

Comments

2

It seems that the iOS Simulator is accepting only decimals with dot instead of comma. For your locale settings the Mac OS uses comma in decimal numbers. I had the same problem because my Mac OS is in portuguese, that uses the comma as default for decimal numbers.

To change this setting, go to System Preferences > Language & Region > Advanced... and change the Decimal value in the number separators from comma (,) to dot (.).

Than, every time you open the custom location prompt, decimal numbers of lat/lon values will appear with dot instead of comma.

Hope it helps.

Comments

1

In Xcode,Product -> Scheme -> Edit Scheme... (command + <).

Select Run/Debug from Side Menu, options tab Select "Allow Location Simulation" and select a default location to none. The default location is the reason for custom location changing.

Set your custom Lat/Long to Simulator...

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.