|
|||||||
![]() |
|
|
Thread Tools | Search this Thread | Display Modes |
|
|
#1 |
|
Subclassed UIViewController returns: 'applications are expected...'
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: Code:
-(id) init
{
self = [super init];
if (self) {
NSLog(@"%@ MasterController init", self);
[self loadView];
return self;
}
else{
return nil;
}
}
Code:
@property (nonatomic, retain) MasterController *masterController; 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;
}
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... |
|
|
|
0
|
|
|
#2 |
|
Must be something in the code / settings we're not seeing because I tried the same thing as above in a test project and it worked fine: no "applications are expected..." message.
__________________
|
|
|
|
0
|
![]() |
|
| Tags |
| subclassed, uiviewcontroller |
«
Previous Thread
|
Next Thread
»
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
Similar Threads
|
||||
| thread | Thread Starter | Forum | Replies | Last Post |
| Subclasses and Protected Methods | darkandlong | iPhone/iPad Programming | 8 | Sep 22, 2011 05:34 AM |
| call method from subclass of uiimageview | sregorcinimod | iPhone/iPad Programming | 3 | Apr 22, 2011 11:54 PM |
| expected '=', ',', ';', 'asm' or '__attribute__' before '*' token | wanting2learn | iPhone/iPad Programming | 4 | Oct 23, 2010 10:35 AM |
| subclass UIViewController and basic template | arnieterm | iPhone/iPad Programming | 0 | Aug 28, 2008 07:30 AM |
| What are these '\n' and '\t' | larswik | Mac Programming | 5 | Oct 7, 2006 10:56 AM |
All times are GMT -5. The time now is 07:36 PM.






I support the 
Linear Mode

