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?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
It looks like you're trying to add an OS X Objective-C class to an iOS project
which produces this..
Instead add the new file like this..
which produces this..
回答2:
I have no idea why the xib box is grayed out (doesn't happen for me), but you can always just go to new file and create a nib from there and set its class to your UIViewController
subclass in interface builder.
回答3:
This is a bug, just select the UIViewController again in the Subclass of combo and it will be enabled again.
Happened to me when i canceled the creation once and opened the dialog again.