Xcode Includes .xib files that have been deleted!

后端 未结 9 1342
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-30 01:11

I have a problem with Xcode that I can\'t seem to resolve. I have a view controller lets call \"foobarViewController\", there was a \"foobarViewController.xib\" to accompany

相关标签:
9条回答
  • 2020-12-30 01:56

    The AppDelegate load the MainWindow.xib, and in the MainWindow, it include your foobarViewController.xib, therefore your problem occurs. Try editing MainWindow, point it to your controller class instead of including the xib.

    0 讨论(0)
  • 2020-12-30 02:02

    Xcode caches the xib files. Possible solutions are:

    1. If you rename your view controller the view will contain only the newer xib file. Older elements will not be shown.

    2. In case you decide to get rid of the xib file and make the view programmatically you can override loadView method in your viewController. Over-ride this method only when you don't want to load the view from a xib file and want to create the view programmatically.

      • (void)loadView { self.view = [[[UIView alloc] init] autorelease]; }

    The problem with deleting the app from device/simulator and then building it again: Users who already have the app on their device and install newer version on top of it will continue to see older xib.

    0 讨论(0)
  • 2020-12-30 02:09

    In XCode4, Command-Option-Shift-K should do the job. Same as product, press the option key, now the option "Clean" will change to "Clean Build Folder ..." select that option.

    0 讨论(0)
提交回复
热议问题