For a reason unknown to me, the Release version of my application has started loading cached static files.
If i build in debug mode all is well and it loads the correct most recent files, this occurs on the device and inside the simulator.
Try going in the menu to XCode -> Empty Caches
Clean all. I don't remember how to get to it in the menus, but I do it often enough I have the keyboard shortcut ingrained. With no debugger running (hit "stop" if you have to), do Cmd-Shift-K. You'll get a confirm dialog asking for the depth of "clean" to do, and take it up on a full cleaning.
That'll delete all cached objects and the next "build and run" will build all targets from scratch, including updated images and nibs that it hasn't been getting fresh.
I fixed the issue by deleting the resources in xcode and also moving the files to trash, then adding them back into the project. Would be nice to find a way to stop this from happening in the future though.
Related
I have a storyboard which contains views which simply refuse to change. If I make changes to the controls they're not reflected in either the simulator or a phone. I don't have a 'Derived Data' folder under /Library/Developer so I can't delete it. I have, however done a clean, with no effect. There must be another cache somewhere it's using.
After a fair amount of scouring, I eventually cleared the cache by emptying /Users/Library/My user/Developer/Derived data, then doing a clean, then restarting Xcode.
I have a strange app behavior: The App updates the GUI changes only after returning from the background to foreground. When launching, some GUI elements are also missing and appearing not until returning from background state. Any touch on buttons fires not until going to background and reentering foreground.
The problem is with iPhone, iPad and both simulators and with Xcode 5.2.1 up to 5.3. It appeared after deleting the app from the devices and resetting the simulator. Beforehand there was never a problem like this with this app.
When you can't fix it, restore it: With version control i reverted the AppName.xcodeproj directory (Finder shows it like a file) and it fixed the problem.
Then Xcode offered me to "upgrade to latest recommended settings and perform project clean up" which "removes unnecessary build files". I did that and also chose the "create snapshot option". After that i had the same problem again.
The i reverted to that snapshot before the project settings update and it worked again.
Key take-away: "upgrading project to latest recommended settings" can have nasty side effects. Snapshots and version control are great stuff.
Further investigation showed that in Settings.bundle one missing Root.plist file was reason enough to kill my GUI. I had there Root~ipad.plist and Root–iphone.plist and thought the Root.plist is no longer needed. Looks like you need all three if you want separate plists for iPhone and iPad.
I've made an iPad App. I was able to run this App on my device and on simulator.
After I've updated several classes (which I tested in simulator) I wasn't able to run my App on my device. It gives no errors but just hangs when compiling.
I'm thinking it's something with a class which came out very large and has some mathematical functions inside (calculations of transforms etc.)
After a long runtime Xcode gives back this error (something about a 'clang error'):
Anyone has any experience with these kind of issues and could find a solution?
EDIT:
Within my viewdidload method i have set 112 float values (i.e. value = 12;) and save them (with NSUSerdefaults).
Only setting these values solved my problem. No idea why this was giving me compile errors. I'm thinking the mathematical functions (after setting the float values) took to much memory or CPU.
Did you try cleaning your build and rebuild again?
Menu > Product > Clean
close & reopen XCode, "Clean All Targets" then rebuild. It should work.
Clean your project, delete the app from you iPad and try again. Should work.
Hope it helps
Are you trying to "Build and Analyze" or an ad-hoc build or debug build?
If your code crashed because of any memory issues or bad access memory due to any infinite loop, try to enable NSZombieEnabled in your executable settings. It will point you to the code snippet where the code crashes.
To enable "NSZombieEnabled", go to
Edit Active Executables -> Arguments -> Variables in the environment -> Add name as "NSZombieEnabled" and value to "YES"
Hopes this helps.
Everytime I do "Build & Go" the app to my device, It installs the app with a white icon, shows a black screen and "Failed to load NSMainNibFile MainWindow" in the debugger.
However after cleaning, and then recompiling it works fine. Is this normal? How do I go about this?
It is not normal.
For some reason your main nib file where your app icon and MainWindow nib are located is either not being created or is corrupted. Presumably this happens during a subsequent build after at least one successful build has been performed following a clean all.
Troubleshooting suggestions:
You should post the exact sequence of builds that triggers the problem. Preferably in a list format so its easy to read.
Check for any unusual resources like images, sounds etc that you may have added. Perhaps something in an usual format is trigging the problem.
Check your target before each compile to confirm that that the MainWindow nib shows up in the resources phase.
Copy your source files and resources to a new project. Sometimes projects get corrupted and when they do, they cannot be repaired.
Check for any resource file names that have unusual characters in them. IIRC, file names with multiple dots can cause problems e.g. my.file.name.jpg.
I'm having some weird issues with Xcode, and this is pretty much impossible to find answers by simply googling around.
I have a few icon image files (just PNGs) in my Xcode project, and when I modify some of them in Photoshop, they don't get updated when I do another build in Xcode. In order to fix this I have to re-add the file again to the project, and then remove the old version of the file that is already in there in Xcode.
What am I doing wrong here? I'm updating/replacing the image file that is stored in my project's directory directly from Photoshop, so I assumed that it would just get reloaded and the new version would show up.
UPDATE: Looks like what happened was that when I first imported the image files into my project, they got added to my "Classes/" sub-directory. So when I was updating them, it was just adding them to the root of my project.
I had the exact same problem.
The following fixed it for me:
In Xcode, go to Project --> Clean
This will purge the old images from xcode cache and will show your new image
That's pretty weird. I'd suggest two things:
Check that you're not saving your
photoshop files into the wrong
directory. I know this seems
straightforward but its worth a
check. Make sure you're not saving
them into the build/ directory or
anything like that.
Before running again in the simulator, try cleaning all build targets first to ensure that your project actually builds again before launching the simulator.