Skip to content

Conversation

@0xTomDaniel
Copy link

@0xTomDaniel 0xTomDaniel commented Jul 5, 2019

If CLLocationManager should be created on the main thread or problems can occur. Here's the error message that is received when not created on the main thread.

A location manager (0x106634fc0) was created on a dispatch queue executing on a thread other than the main thread. It is the developer's responsibility to ensure that there is a run loop running on the thread on which the location manager object is allocated. In particular, creating location managers in arbitrary dispatch queues (not attached to the main queue) is not supported and will result in callbacks not being received.

A few hours was waisted figuring what was wrong with my app until I discovered this error message in my logs.

This pull request guarantees that CLLocationManager is always created on the main thread.

@0xTomDaniel 0xTomDaniel force-pushed the changed/CLLocationManager-thread branch from 5e21ad1 to 652ea87 Compare July 5, 2019 21:39
@0xTomDaniel
Copy link
Author

@sobri909 Any word on this? There have been many commits since creating this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant