打开地图视图时是否可以显示注释?我查看了其他代码,但它们都涉及 objectAtIndex,并且我没有使用 tableview 进行此选择。
这是我用来选择视图的代码,当我单击按钮时它应该打开:
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];
}
应该在单击按钮时打开的地图应该能够识别单击的来源,并打开正确的注释。地图上的每个点都有一个分配给它的名称。
任何帮助表示赞赏。谢谢