Ios 打开地图视图时显示注释
在打开地图视图时是否可以显示注释?我已经看过其他代码片段,但它们都涉及objectAtIndex,并且我没有使用tableview进行此选择 下面是我用来选择视图的代码,当我单击按钮时,该视图应该打开:Ios 打开地图视图时显示注释,ios,objective-c,annotations,mkmapview,ibaction,Ios,Objective C,Annotations,Mkmapview,Ibaction,在打开地图视图时是否可以显示注释?我已经看过其他代码片段,但它们都涉及objectAtIndex,并且我没有使用tableview进行此选择 下面是我用来选择视图的代码,当我单击按钮时,该视图应该打开: Screen1ViewController - (IBAction)mapPressed1:(UIButton*)sender { mapnew *controller1 = [[[mapnew alloc] initWithNibName:@"mapnew" bundle:nil] auto
Screen1ViewController
- (IBAction)mapPressed1:(UIButton*)sender
{
mapnew *controller1 = [[[mapnew alloc] initWithNibName:@"mapnew" bundle:nil] autorelease];
controller1.delegate = self;
controller1.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
[self presentViewController:controller1 animated:YES completion:nil];
// IS IT POSSIBLE TO DO SOMETHING LIKE THIS INTO THE IBACTION FOR IT TO WORK:
[self.mapView selectAnnotation:NameOfAnnotationForSpecificLocationCoordinates animated:YES];
}
应该在点击按钮时打开的地图应该能够识别点击的来源,并打开正确的注释。地图上的每个点都指定了一个名称
感谢您的帮助。
谢谢这里的提问和回答:
您所需要做的就是将数据传递给您的控制器1,以便它在出现时立即显示。您是指注释(地图上的pin)还是指标注(通常在有人点击标注时显示的弹出窗口)?我指的是标注中的标注,但带有标注(pin)的示例也很好。。