不太清楚如何调试。
2013-01-24 20:36:18.448 SlideMenu[2069:c07] *** 由于未捕获的异常“NSInvalidArgumentException”而终止应用程序,原因:“-[initViewController viewControllers]:无法识别的选择器发送到实例 0xac6cdb0”
这是 initViewController.m
#import "initViewController.h"
#import "ECSlidingViewController.h"
#import "MenuViewController.h"
@interface initViewController ()
@end
@implementation initViewController
- (void)viewDidLoad
{
[super viewDidLoad];
self.topViewController = [self.storyboard instantiateViewControllerWithIdentifier:@"Main"];
}
@end
以及抛出异常的地方:
AppDelegate.m
#import "AppDelegate.h"
#import "MainViewController.h"
#import "ListDoc.h"
@implementation AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
ListDoc *list1 = [[ListDoc alloc] initWithTitle:@"Potato Bug" thumbImage:[UIImage imageNamed:@"potatoBugThumb.jpg"]];
ListDoc *list2 = [[ListDoc alloc] initWithTitle:@"House Centipede" thumbImage:[UIImage imageNamed:@"centipedeThumb.jpg"]];
NSMutableArray *lists = [NSMutableArray arrayWithObjects:list1,list2,nil];
UINavigationController * navController = (UINavigationController *) self.window.rootViewController;
MainViewController * mainController = [navController.viewControllers objectAtIndex:0];
mainController.someData = lists;
// Override point for customization after application launch.
return YES;
}
@end