【发布时间】:2013-04-19 01:53:15
【问题描述】:
我对此很陌生,所以请耐心等待。我的代码中有 2 个错误需要修复。在这两种情况下都找不到我的实例方法:
-(IBAction)goFlipSide {
NSLog(@"goFlipSide has been called:");
FlipsideViewController *controller = [[FlipsideViewController alloc] initWithNibName:@"FlipsideViewController" bundle:nil];
controller.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
[self presentViewController:controller animated:YES];
[controller release];
}
- (void)flipsideViewControllerDidFinish:(FlipsideViewController *)controller {
[self dismissViewControllerAnimated:YES];
//This method gets fired when the user clicks done on the modal FlipsideViewController. This is different
//than the viewWillAppear.
self.navigationController.navigationBarHidden = TRUE;
/*
if (self.goViewSuccess == TRUE) {
//if the goViewSuccess boolean is set to YES - then we can load the load the goViewController
NSLog(@"goViewSuccess is YES");
[self loadGoViewController];
}
*/
}
未找到的两个实例方法是:presentViewController: 和 dismissViewControllerAnimated:。
【问题讨论】:
-
谁是
self(这些方法属于哪个类)? -
查看
UIViewController的文档。查看以presentViewController开头的方法。你缺少一个论点。 -
steinm10:据我所知,您是在 iOS6.1 中编写代码。
presentViewController:controller animated:YES和dismissViewControllerAnimated:YES方法在 iOS6.1 中已弃用
标签: ios objective-c cocoa-touch uiviewcontroller