简体   繁体   中英

How to create new View Controllers in XCode 4.3

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?

在此处输入图片说明

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

在此处输入图片说明

我不知道为什么xib框变灰(对我而言这不会发生),但是您总是可以转到新文件并从那里创建一个笔尖,并将其类设置为Interface Builder中的UIViewController子类。

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM