小编kev*_*oza的帖子

如何删除MKMapView上的所有注释

Is there a simple way to delete all the annotations on a map without iterating through all the displayed annotations in Objective-c?

annotations objective-c iphone-sdk-3.0 mkmapview

98
推荐指数
8
解决办法
6万
查看次数

if语句中"or"的语法是什么?

我可以使用多个else if语句,但是有没有更简单,更清晰的方法在objective-c中执行if(条件或其他条件..)?

if-statement objective-c conditional-statements

1
推荐指数
2
解决办法
1499
查看次数

如果声明给我一些麻烦

出于某种原因,这个if语句给了我一个"Expected:before"令牌.

    if ([ [mine commodity] isEqualToString:@"Gold"] && [gold == YES])
    {
        [tempMine setAnnotationType:iProspectLiteAnnotationTypeGold];
        [mapView addAnnotation:tempMine];
    }
Run Code Online (Sandbox Code Playgroud)

我有没有看到一些错字?

if-statement objective-c iphone-sdk-3.0

0
推荐指数
1
解决办法
51
查看次数

如何获取用户位置的纬度和经度?

我需要访问mainViewController中包含的此方法中的用户位置

-(void)loadAnnotations{
[mapView removeAnnotations:mapView.annotations];

CLLocationCoordinate2D workingCoordinate;
workingCoordinate.latitude= //here i need the users latitude
workingCoordinate.longitude= //here i need the users longitude
NSLog(@" this is %@", workingCoordinate.latitude);
iProspectLiteAnnotation *tempMine = [[iProspectLiteAnnotation alloc] initWithCoordinate:workingCoordinate];
[tempMine setTitle:@"Present Location"];
[tempMine setAnnotationType:iProspectLiteAnnotationTypeUser];
[mapView addAnnotation:tempMine];
}
Run Code Online (Sandbox Code Playgroud)

但是mainViewController已经设置为

<fipsideViewControllerDelegate>
Run Code Online (Sandbox Code Playgroud)

我应该在头文件和实现文件中添加什么来轮询位置管理器以获取用户当前的纬度和经度?

objective-c core-location iphone-sdk-3.0

-2
推荐指数
1
解决办法
2562
查看次数