Jump to content

  • Log In with Google      Sign In   
  • Create Account


View controller without a 'nib / xib'


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   -  Reputation: 604

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. :)

Sponsor:

#2 DarkRonin   Members   -  Reputation: 604

Like
0Likes
Like

Posted 22 August 2012 - 03:32 PM

Really? No-one played with iOS development?

#3 DarkRonin   Members   -  Reputation: 604

Like
0Likes
Like

Posted 23 August 2012 - 05:39 AM

Fixed it. Thanks for the help :)




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.



PARTNERS