当我在iphone sdk中使用PresentModelView时,应用程序崩溃了

时间:2012-01-09 13:16:33

标签: iphone objective-c presentmodalviewcontroller

这是我的代码:

 -(void)btnAction
  {
   mapController = [[MKMapController alloc] initWithNibName:@"MKMapController" bundle:nil];
mapController.delegate = self;
mapController.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;

[self presentModalViewController:mapController animated:YES];
[mapController release];
  }

我收到崩溃消息:

-[MKMapController respondsToSelector:]: message sent to deallocated instance 0x79ccc90

盖伊,请帮我解决这个问题.. !!

感谢所有人, Monish。

1 个答案:

答案 0 :(得分:0)

以dealloc方式释放mapController