Ich versuche, die Funktion locationServicesEnabled zum Funktionieren zu bringen ... aber mein UIAlert zeigt sich, egal ob locationServices aktiviert ist oder nicht! Wie bekomme ich das richtig?locationServicesEnabled in iOS> 4.0 zeigt immer UIAlert
@synthesize locationServicesEnabled
-(void)viewDidLoad {
[super viewDidLoad];
if(![CLLocationManager locationServicesEnabled]) {
self.locationManager = [[[CLLocationManager alloc] init] autorelease];
locationManager.delegate = self;
locationManager.desiredAccuracy = kCLLocationAccuracyBest;
[locationManager startUpdatingLocation];
} else {
[[[[UIAlertView alloc] initWithTitle:@"Location services."
message:@"Location services are disabled."
delegate:nil
cancelButtonTitle:@"OK"
otherButtonTitles:nil] autorelease] show];
}
}
Vielen Dank im Voraus!
Ist das eine Unteransicht? –
yeah, es ist eine Unteransicht – Krismutt