Xcode Includes .xib files that have been deleted!

后端 未结 9 1341
爱一瞬间的悲伤
爱一瞬间的悲伤 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:42

    Try these 3 things:

    • Delete app from simulator

    From Xcode:

    • Build Menu -> Clean All Targets -> Check both boxes -> Clean
    • XCode Menu -> Empty Caches... -> Empty
    0 讨论(0)
  • 2020-12-30 01:50

    In iOS Simulator Menu > Resent Contents and Settings

    Is sufficient.

    0 讨论(0)
  • 2020-12-30 01:51

    check out this post: How to Empty Caches and Clean All Targets Xcode 4

    "Command-Option-Shift-K to clean out the build folder. Even better, quit Xcode and clean out Library/Developer/Xcode/DerivedData manually. Remove all its contents because there's a bug where Xcode will run an old version of your project that's in there somewhere.

    In the simulator, choose iOS Simulator > Reset Content and Settings.

    Finally, for completeness, you can delete the contents of /var/folders; some caching happens there too." - Matt

    0 讨论(0)
  • 2020-12-30 01:53

    Are you sure it was deleted? You may have only removed the reference to it. Open the project folder and make sure it isn't there. Better yet, do a search in spotlight for the filename.

    If you can't find the file, it's still unresolvable, and you made the view controller programmatically, try pasting your code into a text editor, delete the classes, and re-make it and paste the code back in.

    0 讨论(0)
  • 2020-12-30 01:54

    Did you delete the app from the simulator? When Xcode installs a development build, either in the Simulator or on the device, it doesn't delete existing files. It simply overwrites files and adds new files. This means that if you delete a file from Xcode, it will be left in the already-installed built product. The solution is to delete the product from your simulator/device before installing.

    0 讨论(0)
  • 2020-12-30 01:55

    Sometimes it is very annoying to remove the app from the device/simulator, especially when you have saved data and configuration.

    To solve this issue, for every View Controller for which you removed the .xib file add the following code:

    -(NSString*) nibName
    {
        return nil;
    }
    
    0 讨论(0)
提交回复
热议问题