Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

There is no .xib file when I create a new "Single View Application" in XCode 5

Tags:

xcode5

when i create a new project selecting option (single view application) in xcode 5, it automatically add Main.storyboard there is no option for selecting .Xib file as we select in previous version of xcode. Please someone explain this

like image 720
Akhtar Avatar asked Sep 30 '13 11:09

Akhtar


1 Answers

My suggestion is:

  1. Create an empty app
  2. Go to File/New/File, Choose Objective-C Class
  3. Name your class ViewController(or whatever you like), make it subclass of UIViewController Make sure you have checked the box "with xib for user interface."

  4. Open appDelegate.h, put

@class ViewController;

between @interface and #import, and this property below:

@property (strong, nonatomic) UIViewController *viewController;
  1. Open your appDelegate.m: import your ViewController

#import "ViewController.h"

and before

[self.window makeKeyAndVisible];

put

 self.viewController = [[ViewController alloc] initWithNibName:@"ViewController" bundle:nil];
    self.window.rootViewController = self.viewController;
like image 146
Matti Avatar answered Dec 02 '22 07:12

Matti