Alerts appear for a second or do not appear when an application is launched in a project with ARC (without using ARC, everything is in order). (I add the CoreLocation structure and import it into the project).
My code is:
#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; }
source share