Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/iphone/41.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/objective-c/22.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 集成MAPKIT并添加辅助功能箭头_Iphone_Objective C_Ios_Mapkit - Fatal编程技术网

Iphone 集成MAPKIT并添加辅助功能箭头

Iphone 集成MAPKIT并添加辅助功能箭头,iphone,objective-c,ios,mapkit,Iphone,Objective C,Ios,Mapkit,我遵循这一点,将MAPKIT添加到我的应用程序中,并在地图上显示一些数据,如图所示 我需要在地图描述中找到蓝色箭头(辅助功能控制)。我的代码如下,如何在上面添加蓝色的辅助功能箭头 - (void)viewDidLoad { [super viewDidLoad]; [mapView setMapType:MKMapTypeStandard]; [mapView setZoomEnabled:YES]; [mapView setScrollEnabled:YES];

我遵循这一点,将
MAPKIT
添加到我的应用程序中,并在地图上显示一些数据,如图所示

我需要在地图描述中找到
蓝色箭头
(辅助功能控制)。我的代码如下,如何在上面添加蓝色的辅助功能箭头

- (void)viewDidLoad {
[super viewDidLoad];

    [mapView setMapType:MKMapTypeStandard];
    [mapView setZoomEnabled:YES];
    [mapView setScrollEnabled:YES];
    MKCoordinateRegion region = { {0.0, 0.0 }, { 0.0, 0.0 } }; 
    region.center.latitude = 22.569722 ;
    region.center.longitude = 88.369722;
    region.span.longitudeDelta = 0.01f;
    region.span.latitudeDelta = 0.01f;
    [mapView setRegion:region animated:YES]; 

    [mapView setDelegate:self];

    DisplayMap *ann = [[DisplayMap alloc] init]; 
    ann.title = @" Kolkata";
    ann.subtitle = @"Mahatma Gandhi Road"; 
    ann.coordinate = region.center; 
    [mapView addAnnotation:ann];
}
完整的代码可以在教程中找到


以及如何编辑代码以添加自定义图像,而不是默认的红色pin?

您可以在mapView:viewForAnnotation中设置蓝色箭头:

pin.rightCalloutAccessoryView = [UIButton buttonWithType:UIButtonTypeDetailDisclosure];