It's been a while since I've used UIKit to any extent (been enjoying cocos2d for my game stuff). It seemed to flow really easy though when I went back, right up until the moment I decided to make an app that was not set up with a xib-containing template.
Upon running it in the simulator I received the following message: "applications are expected to have a root view controller at the end of application launch."
Which sounds sensible. However what I can't break my head around is why it my subclassed UIViewController won't be accepted as a view controller..
I have a subclassed UIViewController class called MasterController. It has the following init method:
I've added the following property to my AppDelegate:
It should all come together in the application: didFinishLaunchingWithOptions: method
The above mentioned message is returned though.
If I replace my own class with a standard UIViewController the message is not returned so it seems obvious that my subclass is not accepted for some reason...
Upon running it in the simulator I received the following message: "applications are expected to have a root view controller at the end of application launch."
Which sounds sensible. However what I can't break my head around is why it my subclassed UIViewController won't be accepted as a view controller..
I have a subclassed UIViewController class called MasterController. It has the following init method:
Code:
-(id) init
{
self = [super init];
if (self) {
NSLog(@"%@ MasterController init", self);
[self loadView];
return self;
}
else{
return nil;
}
}
I've added the following property to my AppDelegate:
Code:
@property (nonatomic, retain) MasterController *masterController;
It should all come together in the application: didFinishLaunchingWithOptions: method
Code:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
NSLog(@"%@ AppDelegate application", self);
self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease];
self.window.backgroundColor = [UIColor blackColor];
self.masterController = [[[MasterController alloc] init]autorelease];
self.window.rootViewController = self.masterController;
[[self window] makeKeyAndVisible];
return YES;
}
The above mentioned message is returned though.
If I replace my own class with a standard UIViewController the message is not returned so it seems obvious that my subclass is not accepted for some reason...