0
这是什么原因造成的?我在Xcode 4.3上运行iOS 5.1并使用Storyboard。无法识别的应用程序中的选择器didFinishLaunchingWithOptions与topViewController分配
'NSInvalidArgumentException', reason: '-[WFTopTableViewController topViewController]: unrecognized selector sent to instance 0x6d56f80'
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
// Initial view controller is a Table View Controller, so we look up the window's rootViewController.
UINavigationController *navigationController = (UINavigationController *)self.window.rootViewController;
// Set up the controller.
WFTopTableViewController *controller = (WFTopTableViewController *)navigationController.topViewController;
// Pass the controller the managed object context for the first time.
controller.managedObjectContext = self.managedObjectContext;
return YES;
}
谢谢! 阿曼达
除非WFTopTableViewController是UINavigationController的子类,否则该代码不会飞。 – CodaFi