The alerts appear for a split-second or did not show when application launches in project with ARC (without using ARC all it's OK). (I add CoreLocation framework and I import it to project).
My code:
#import <CoreLocation/CoreLocation.h>
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions{
CLLocationCoordinate2D coordinate;
CLLocationManager *locationManager = [[CLLocationManager alloc] init];
NSLog(@"jestem po okienku ");
if (locationManager.locationServicesEnabled == NO)
{
coordinate.latitude = 0.0;
coordinate.longitude = 0.0;
}
else
{
locationManager.desiredAccuracy = kCLLocationAccuracyBest;
[locationManager startUpdatingLocation];
CLLocation *location = [locationManager location];
if (!location) {
coordinate.latitude = 0.0;
coordinate.longitude = 0.0;
}
// Configure the new event with information from the location.
coordinate = [location coordinate];
}
return YES; }