How to Empty Caches and Clean All Targets Xcode 4 and later

后端 未结 12 2169
囚心锁ツ
囚心锁ツ 2020-11-21 07:07

Jonathan suggest here: Xcode Includes .xib files that have been deleted! that cleaning all targets and empty the caches will fix the problem with Xcode including deleted .xi

相关标签:
12条回答
  • 2020-11-21 07:52

    Here's my shell script solution, which deletes derived data and cleans a project's cached assets, for Xcode 4, 5 and 6.

    Sometimes, simply calling rm -rf on the Derived Data directory leaves a lingering file or two, but my script loops until all files are deleted.

    0 讨论(0)
  • 2020-11-21 07:59

    In addition to doing the following, you may experience this issue if your app's Storyboard's files are localized. First, do each of these:

    • Clean Build
    • Reset Simulator
    • Restart Xcode
    • Delete your DerivedData folder in ~/Library/Developer/Xcode/DerivedData
    • Restart Computer

    What finally worked for me was re-generating the storyboard localization files and deleting the English localization (which was unneeded because the Base Locale is English). To reload your Storyboard strings, see this answer on StackOverflow.

    I had noticed that the non-text parts of my Storyboard were being updated, but not the localized text. If you have a localization in your app, I would recommend checking to make sure your localizations are updated (even if they're .strings files).

    0 讨论(0)
  • 2020-11-21 07:59

    My "DerivedData" with Xcode 10.2 and Mojave was here:

    MacHD/Users/[MyUser]/Library/Developer/Xcode

    0 讨论(0)
  • 2020-11-21 08:00

    You have to be careful about the xib file. I tried all the above and nothing worked for me. I was using custom UIButtons defined in the xib, and realized it might be related to the fact that I had assigned attributes there which were not changing programmatically. If you've defined images or text there, remove them. When I did, my programmatic changes began to take effect.

    0 讨论(0)
  • 2020-11-21 08:01

    I tried almost everything but could not help,what helped me was disabling SIP(System Integration Protection) n it works,I do not know what happens when and how but system file get confused somewhere and causes this...though there might be risks to disabling this obviously

    here is how

    1.Power on your Mac and hold down the [command]+[R] keys to access the Recovery Partition.

    2.From the Recovery Partition, click Utilities from the menu bar, and then select Terminal.

    3.Enter the following command into Terminal and press Enter to execute it: csrutil disable

    4.Once the command has executed, exit the Terminal and reboot the Mac. When you log back into OS X, SIP will be disabled.

    0 讨论(0)
  • 2020-11-21 08:04

    I have been pulling out hair from my head because I thought that I had the same problem. When building the app I didn't get the same result on my iPhone as on the simulator.

    The problem was that I had somehow made a localized version of the MainStoryboard.storyboard file. So when I ran the app on my phone it showed the danish version... and the simulator showed the english version.

    Yeah I'm new! :)

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