Take the 2-minute tour ×

I have a method (myMethod) in a class (myClass) which utilizes the CLLocationManager to startMonitoringSignificantLocationChanges(). MyClass is the delegate of the CLLocationManager and I have implemented the didUpdateToLocation() method.

What I want to do is call startMonitoringSignificantLocationChanges() from within myMethod, then once didUpdateToLocation() has been called and completed I want to continue working in myMethod. Is this possible?

share|improve this question

2 Answers 2

up vote 7 down vote accepted

I won't say that it's impossible, but I strongly urge you to embrace the asynchronous nature of how this works, and to find another way to do what you're trying to do. Like split up myMethod into "before" and "after" parts, and let your delegate trigger the "after". This is a really common pattern in Cocoa/iOS, and you'll be happier in the long run not fighting the framework.

This is especially true if myMethod is something that's running on the main thread, because blocking that thread while waiting for location updates will lock up your entire UI. Take too long, and the system will kill your app.

share|improve this answer
The most useful advice I've ever read on SO. A light bulb came on for an issue I've had for a long time. –  trudyscousin Feb 14 '12 at 3:20

No, it's not, but you don't need that. Just continue your functionality in the didUpdateToLocation once you get the data you need.

share|improve this answer

Your Answer


