MKMapView-iphone开发

MKMapView-iphone开发,iphone,uinavigationcontroller,Iphone,Uinavigationcontroller,我有一个基于导航的应用程序。 第一个视图是tableView,当我按下第三个单元格时,我将被导航到MapViewController else if (2 == indexPath.row) { MapViewController *maps = [[MapViewController alloc] initWithNibName:@"MapViewController" bundle:nil]; maps.title=@"Maps"; [self.n

我有一个基于导航的应用程序。 第一个视图是tableView,当我按下第三个单元格时,我将被导航到MapViewController

else if (2 == indexPath.row)
    {   MapViewController *maps = [[MapViewController alloc] initWithNibName:@"MapViewController" bundle:nil];
        maps.title=@"Maps";
        [self.navigationController pushViewController:maps animated:YES];
        [maps release];
    }

这个代码怎么了?我弄错了

您需要将
MapKit.framework
添加到您的Xcode项目中

Xcode 4

  • 选择目标->构建阶段->将二进制文件链接到库
  • 单击右下角的小“+”
  • 添加
    MapKit.framework
  • 重新编译

  • 视图未加载(未导航)2011-07-24 01:41:03.663 Cafeyones[11858:207]***由于未捕获的异常“NSInvalidUnarchiveOperationException”而终止应用程序,原因:“***-[nsKeyedUnachiver decodeObjectForKey::无法在第一次抛出时解码类的对象(MKMapView)***调用堆栈: