开发者

rename xib file

I started to create an app using tabbar app template provided in xcode. Then I wanted to change the names of the files: FirstViewController should become YellowViewControler and FirstView.xib should become YellowViewcontroller.xib. Changing the name of the xib wasn't done right. It became red as if it didn't exist in the project. So: how should I change 开发者_C百科the name of the xib files?


Use the "Refactor" tool of Xcode.

This will manage the renaming of the XIB file, the renaming of the interface & implementation of the source file containing the definition of the ViewController, the renaming of your class declarations/definitions, and any references that are used anywhere in your projects, all of this in one action.


Rename the stuff back to what their original name was (FirstViewController) and then go to the interface file for it (.h) and right click on the class name (FirstViewController) and click refactor. This should make sure everything gets changed correctly.

Source this question


Most likely your viewcontroller name still linked to previous owner therefore open the viewcontroller.xib in source code and find the owner and changed to current name. It will fix the problem right away.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜