Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create new View Controllers in XCode 4.3

Tags:

xcode

iphone

So I have figured out that in XCode 4.3, to create a new ViewController, I have to do New > Objective-C Class, then subclass UIViewController. But, how come the xib checkbox is greyed out? How do I create a new view controller with an xib?

enter image description here

like image 459
user1007895 Avatar asked May 22 '12 19:05

user1007895


People also ask

How do I create a view controller in Xcode?

Click on background of Main. storyboard . Search and select ViewController from object library at the utility window. Drag and drop it in background to create a new ViewController .

How do I add a view controller to my storyboard?

Open Main. storyboard and select the Tab Bar Controller Scene. On the right, select the Attribute inspector. You'll find a checkbox named Is Initial View Controller.


1 Answers

It looks like you're trying to add an OS X Objective-C class to an iOS project

enter image description here

which produces this..

enter image description here

Instead add the new file like this..

enter image description here

which produces this..

enter image description here

like image 185
Mick MacCallum Avatar answered Sep 22 '22 03:09

Mick MacCallum