samxli
samxli

Reputation: 1596

Is it possible to get ivars with startMonitoringSignificantLocationChanges in backgrounded mode

When an app uses startMonitoringSignificantLocationChanges while backgrounded or when terminated, if a significant change is detected Apple states that it will bring the app back into the foreground. But, will I still be able to get the value of an ivar (previously set when the app was in the foreground) within the didUpdateToLocation CLLocationManager delegate method? Or is it lost?

If it is lost, what is the best way to persist those values after the app has terminated/backgrounded and brought back into the foreground by the location manager?

Upvotes: 1

Views: 255

Answers (1)

Lily Ballard
Lily Ballard

Reputation: 185801

Yes of course you will. The only way you'd lose the value of that ivar is if your app has actually quit and been relaunched, at which point you're not simply coming back from the background.

Upvotes: 1

Related Questions