我正在制作一个地图中有多个引脚的应用程序。(在 iOS 应用程序中使用 xcode)当我点击图钉时,标注会出现一个披露按钮,按下该按钮会弹出一个新的视图控制器(我将其用作详细视图……这是正确的吗?)
在查看新的视图控制器后,我目前在返回原始视图控制器时遇到问题。
我应该如何继续返回地图视图?
我试过 -(IBAction)Back; 命令并将其链接到新视图控制器上的按钮,但是当我在模拟器中单击它时,出现黑屏并且输出中没有显示错误..
任何帮助,将不胜感激!
我使用以下内容查看新的视图控制器:
- (void)mapView:(MKMapView *)mapView annotationView:(MKAnnotationView *)view calloutAccessoryControlTapped:(UIControl *)control {
if ([view.annotation.title isEqualToString:@"..."]) {
...Controller *sampleView = [[...Controller alloc] init];
[self presentModalViewController:sampleView animated:YES];
}
if ([view.annotation.title isEqualToString:@"..."]){
...ViewController *sampleView = [[...ViewController alloc] init];
[self presentModalViewController:sampleView animated:YES];
}
}
编辑1:这是我做出改变后得到的错误代码..
2013-06-30 18:02:30.386 lam[15156:13d03] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '-[UIViewController _loadViewFromNibNamed:bundle:] loaded the "...Controller" nib but the view outlet was not set.'
*** First throw call stack:
(0x1e2d012 0x126ae7e 0x1e2cdeb 0xf88c8 0xf8dc8 0xf8ff8 0xf9232 0x104c25 0x3043a3 0x101ee3 0x102167 0xfee0071 0x374c 0x10deb1a 0x10ea28e 0x82f617f 0x127e705 0x1b2c0 0x1b258 0xdc021 0xdc57f 0xdb6e8 0x4acef 0x4af02 0x28d4a 0x1a698 0x1d88df9 0x1db0f3f 0x1db096f 0x1dd3734 0x1dd2f44 0x1dd2e1b 0x1d877e3 0x1d87668 0x17ffc 0x2842 0x2775)
libc++abi.dylib: terminate called throwing an exception