Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/117.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Iphone 核心位置警报_Iphone_Ios_Alert_Core Location - Fatal编程技术网

Iphone 核心位置警报

Iphone 核心位置警报,iphone,ios,alert,core-location,Iphone,Ios,Alert,Core Location,我在O'Reilly教程中看到了以下警报: 我不知道如何触发这些警报。请你告诉我好吗?使用ios6的应用程序好吧,它非常简单。它被称为UIAlertView,非常常见于发出通知。它们应该用于通知用户一些事情,而不是用于交互 在编码方面,以下是一些基本设置文本: UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Alert" message:@"Alert Body" delegate:self cancelButtonTitl

我在O'Reilly教程中看到了以下警报:


  • 我不知道如何触发这些警报。请你告诉我好吗?使用ios6的应用程序好吧,它非常简单。它被称为
    UIAlertView
    ,非常常见于发出通知。它们应该用于通知用户一些事情,而不是用于交互

    在编码方面,以下是一些基本设置文本:

    UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Alert" message:@"Alert Body" delegate:self cancelButtonTitle:@"Dismiss" otherButtonTitles:nil, nil];
    
    要显示警报,请执行以下操作:

    [alert show];
    
    如果需要其他按钮标题,则需要将
    委托
    设置为
    self
    ,并在.h文件中与
    UIAlertViewDelegate
    保持一致。您基本上希望实现
    ClickedButtonIndex:
    方法,并使用索引找出用户按下的按钮并执行操作


    这是访问当前位置时发出的警报,当您使用

    请阅读更多信息

    -(void)getLocation
    {
        locationManager = [[CLLocationManager alloc] init];
        locationManager.delegate = self;
        locationManager.distanceFilter = kCLLocationAccuracyHundredMeters;
        locationManager.desiredAccuracy = kCLLocationAccuracyBest;
    
        NSLog(@"eee%f",locationManager.location.coordinate.latitude);
        // Start updating location changes.
        [locationManager startUpdatingLocation];
    }
    
    
    - (void)startUpdatingCurrentLocation
    {
        //NSLog(@"STARTUPDATELOCATION");
        // if location services are restricted do nothing
        if ([CLLocationManager authorizationStatus] == kCLAuthorizationStatusDenied ||
            [CLLocationManager authorizationStatus] == kCLAuthorizationStatusRestricted )
        {
            return;
        }
    
        // if locationManager does not currently exist, create it
        if (!locationManager)
        {
            locationManager = [[CLLocationManager alloc] init];
            [locationManager setDelegate:self];
            locationManager.distanceFilter = 10.0f; // we don't need to be any more accurate than 10m
    
    
        }
    
        [locationManager startUpdatingLocation];
    
        // [self showCurrentLocationSpinner:YES];
    }