Jump to content

View more

Image of the Day

Inventory ! Va falloir trouver une autre couleur pour le cadre D: #AzTroScreenshot #screenshotsaturday https://t.co/PvxhGL7cOH
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.


Sign up now

View controller without a 'nib / xib'

4: Adsense

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.


  • You cannot reply to this topic
2 replies to this topic

#1 DarkRonin   Members   

1173
Like
0Likes
Like

Posted 22 August 2012 - 06:04 AM

Hi Guys,

I am trying my hand at iOS programming and am about four hours into it.

I have managed to create a basic layout using a hybrid of a 'nib' file and programmatically creating buttons, to see how it is done.

I have just started a new app where I am trying to make a basic UI without the use of a 'nib' at all.

So, far so good. But I am having troubles making the view controller for the window.

This is what I have so far

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
    // Override point for customization after application launch.
    self.window.backgroundColor = [UIColor whiteColor];
    self.viewController = [[ViewController alloc] initWithNibName:@"ViewController" bundle:nil];
    self.window.rootViewController = self.viewController;
   
    [self.window makeKeyAndVisible];
    return YES;
}


Although, this causes the app to crash as it is calling initWithNibName:@"ViewController" which doesn't exist.

How do I tell the viewController that I am not using a 'nib' so it will then go and call loadView?

Any help would by much appreciated. And please be gentle as I am a C++ Win32 coder, so all of this iOS stuff is new to me.

Thanks in advance. :)
Win32 Developer
One Of Them - Martial arts game that is mid development.

#2 DarkRonin   Members   

1173
Like
0Likes
Like

Posted 22 August 2012 - 03:32 PM

Really? No-one played with iOS development?
Win32 Developer
One Of Them - Martial arts game that is mid development.

#3 DarkRonin   Members   

1173
Like
0Likes
Like

Posted 23 August 2012 - 05:39 AM

Fixed it. Thanks for the help :)
Win32 Developer
One Of Them - Martial arts game that is mid development.




Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.