NaXir
NaXir

Reputation: 2413

CLLocation authorisation popup alert auto dismiss

Why alert for authorisation of getting location auto dismiss after 2 sec and as I don't have any authorisation so delegates are not working? Any help? I am not using ARC.

Upvotes: 1

Views: 271

Answers (2)

It happens if you have the location manager as variable instead of attribute. When the method (usually viewDidLoad) reaches its end, it deallocates the variable and the auth pop up disappears.

Upvotes: 1

tagyro
tagyro

Reputation: 1679

I suppose you are using ARC so keep in mind that the manager has to be an instance variable (not local) otherwise it gets released!

if (![CLLocationManager locationServicesEnabled]) {
    [manager startUpdatingLocation];
}

Upvotes: 2

Related Questions