xcode delete all data from coder archive - xcode

I am using state restoration for my view controllers in Xcode 7.1. But whenever the app initiates on either the simulator or iPhone the old tableview appears. It has rows in it I want to get rid of but my delete code doesn't work. Is there some way to delete coder archived data from a previous build so I get a completely clean tableview to start? I tried in the build target but that didn't help. If I could find where the coder archived data lives in the simulator and get rid of it, maybe that might work?
Here is the state restoration code:

Are you referring to the Derived Data? Xcode allows you to delete the folder, it contains the index, build output and logs. However, I would do a clean then build first, then reset the simulator settings if necessary.
To delete the Derived Data: Window > Projects > select your project and delete

No. I was looking for the DocumentsDirectory in Library/Developer. Here is a link
to a discussion that answered my question. I was able to go in there and delete the *.archive files that were giving me trouble. To be more specific, I incorrectly added some arrays to sections in a tableView, and used State Restoration to save them when I killed the app in Xcode. Then my delete code got exceptions for iterating outside the arrays so I couldn't get rid of them programmatically. But by deleting the archive files using this procedure, I am back in business.
link to access documents directory

Related

Issue with Xcode in Main.Storyboard

I've been working on a project the last few weeks in Xcode and everything's been great. Main.Storyboard all of a sudden, will not load or open. Other projects open fine. There hasn't been any significant changes in this project. The last thing I tried doing was adding a navigation bar to one of my view controllers, to add buttons or items. I also tried adding a navigation item. Things started to complicate after trying to do these things. I have the latest version of Xcode, my project settings are linked correctly and tried rebooting my Mac but it doesn't solve anything. Does anybody know what may have caused this error and how to resolve?
The easy way:
Check out the latest working version of the storyboard file and try the changes again. Likely something odd and transient happened that corrupted the existing storyboard file (I've seen it happen with managed object model files before which are also XML underneath).
If there are too many changes to redo them:
Make a copy of the current storyboard file outside the repo and then checkout the latest working version of the file from the repo.
Diff the two files moving over changes that make sense from the troublesome file keeping an eye out for balanced tags (i.e. if a view has an opening tag but no closing tag Xcode will get confused).
Try opening the modified storyboard in Xcode. With luck it will open and be fine. Otherwise you will need to do a bit more digging or go back to option one and redo the changes.
I downloaded your repo and I can open Main.storyboard just fine:

After updating Xamarin and Xcode, failing to run app on iOS device

I recently updated Xcode and Xamarin and when I deploy my project to my simulator on iOS it works well. But when I however try to use my phone that has been working succesfully for many months now it does not work and I get this error in the log:
System.IO.FileNotFoundException: /Users/Carlos/Projects/Myproject/iOS/obj/iPhone/Debug/build-iphone8.1-9.3.2/ibtool-link/LaunchScreen.storyboardc/02J-Ip-oVM-view-Ze4-5b-2t2.nib does not exist
My bundle identifier matches my provisioning profile that I have made on apple.
I have tried to delete the obj and bin folders in the projectmap/mainmap (not the obj and bin-folders inside the iOS folder) but without any success. I have also rebuild the project and cleaned it but the problem still remains.
When I create a brand new project however it works. So it seems to be a problem with old projects only.
In the map on my old project I cannot even find "ibtool-link" and if I check the newly made project I just made i can see it there and other maps as well. Can I solve it by copying them over? Or is there a better solution?
Any ideas what it might be?
You might try the suggestions (I saw at least 2 different ones) in this post which are:
simply right click on the xib and open it in IB. I then turn around and close it in IB and that gets me past the error.
And
make sure 'Main Interface' empty in info.plist.
Remove Bin and Obj folder.
Also you might try deleting the build cache on your mac by going to /Users/<Your User Account Name>/Library/Caches/Xamarin/mtbs/ and then delete the folder that is the same name as your solution (there might be 2, one with iOS in the name, delete both). This will get recreated when you rebuild your solution.

XCode: Still Able To Access Deleted .plist Files...Why?

I noticed something odd today. I have an application that writes/read data to a .plist file, and when I deleted that file and left all my code in my implementation file the same, I ran the application in the simulator and it was still able to read/write data to this deleted file.
However, if I try to read data from this deleted file in another view controller, they cannot find it. Very very strange.
Is this a known issue in Xcode, or is there something I am probably doing wrong?
If I need to provide some sample code I will, just let me know.
The simulator loves to do this kind of thing, Try clicking "Reset Content and Settings" in the simulator, and cleaning targets in Xcode command-shift-K. Now if that doesn't completely do it you may have to restart Xcode. Another thing I've noticed when working with a .plist is that sometimes if the .plist is deleted and the code is intact, when you execute a write command it has created to the .plist file to write to.
EDIT:

Adding a CoreData Data Model file to XCode 4.2 causes source control to stop working with a question mark

I've been trying in vain for hours now to add a CoreData Data Model file to my XCode project, which is under SVN source control. Whenever I do, I get the following display in XCode:
I've followed at least 5 or 6 different articles now on ways to make subversion play nicely with xcdatamodeld files/folders in XCode 4 without much success. I'm about to just give up and leave my data model file outside of source control, but I can't even get subversion/xcode to ignore it. Winning is not an option.
Things I've tried so far:
command line add/commit of the Data.xcdatamodeld - this causes XCode 4.2
to go into a tiz and crash repeatedly
ignoring the file in XCode Organizer - this causes XCode to report build warnings about a missing Data.xcdatamodeld file, which isn't there in xcode, on the file system or SVN
I've followed the suggestion here: http://www.tmro.net/2010/10/subversion-and-core-data-versioning/ only to have XCode then start crashing during any SVN operation at all (I had to delete my local version completely and reload from the repository)
I can replicate this in a controlled environment outside of my project
Has anyone seen this before and resolved this issue in XCode?
I can't be the first person to try to add a CoreData Data Model file to an SVN controlled project!
Thanks
I saw this also for an otf font bundle.
My datamodel file was stored oddly. In my project directory I had:
./Model.xcdatamodeld/Model.xcdatamodeld/contents
i.e. doubled-up directories
I did a commandline svn on the inner folder only, i.e.
cd ./Model.xcdatamodeld; svn ci Model.xcdatamodeld
It added the inner directory and the contents file, the ? disappeared in XCode and it committed fine. Don't see how the nested directories could be a problem, but this worked for me.

Xcode shows old, deleted xib files

I've searched all over and haven't found any help...
I built a small test app with two UIViewControllers and their corresponding xibs. Things were fine, then I made some changes to both xibs but when I build and run, I get the old views. I've tried deleting the build folders, running in the simulator and device, cleaning all targets and still the same, old, broke-down xibs that I totally changed are still showing up. I've restarted all the Xcode apps and even my computer.
Getting pretty irritated!
EDIT: I never did figure out what the problem was. Basically, once I had built a project, it remembered the first xibs I made and wouldn't recognize changes to them. If I told a view controller to load from a different, valid nib name, it'd complain that the old one wasn't there.
I reinstalled Xcode and now it all works again. Sheesh.
Try deleting the app from the simulator (hold down on the app's icon to get to jiggle mode, then click the X by the app) and from your device. Then let Xcode reinstall it.
just clean the build using
Product -> Clean
menu.
Just modify your XIB files a bit, then save them, xCode will detect a modification (last modified date in the file system) then load the xib from its actual path, and not from a cache-path :P
I just found (and fixed) a related problem — one that demonstrates similar symptoms but whose root cause is slightly different.
In particular, the symptoms I observed were that my iPad app would initially display an old storyboard image for the first page and, after a short delay, would bring up the most recently edited story board contents. I went through most of the above machinations to no avail.
The problem is that the iPad loader first just dumbly loads your app's launch image into the screen. You usually set up this image as part of the early administrative setup of the app in XCode. At launch time, while the end user is considering the content and cogitating about where to touch the screen, the application is in the mean time madly getting itself ready, un-archiving the xib/nib/storyboard, and doing the real work of getting ready.
In the ideal situation the provided launch image is pixel-for-pixel the same as the one generated by the nib-unarchiving-process. However, if you forgot to update your launch image after updating the story board, you'll see an image shift at the completion of the unarchiving.
I wouldn't have suspected this as the problem except that I had read Jef Raskin's description of how he did exactly this on the Canon Cat word processor to provide the illusion of an instantly ready application: it takes advantage of the fact that the typical human response time to an application startup is on the order of seven seconds — plenty of time for even a floppy-based system to load and overwrite the bitmap facade that the loader sets up. Sometimes, it's good to have read a bit of arcane history. Jef would of course later go on to found a project whose name was Macintosh, and the rest is history — and this bug.
Not sure whether this helps, but I just had this.
It took me days to work it out. In my case I enhanced an existing Xib file. The changes I applied in interface builder never appeared in the app.
Eventually I found the cause. I had my FilesOwner view outlet set to a subview below the top view. When I enhanced the view I did this as an extension to th top view. Thus the changes never appeared when running the app.
Changing the view outlet to the correct view ( the top view in my case ) did the trick and it all worked fine ...
I know steve has found a work around but the problem is not in the XIB files at all. Xcode does not update the YouApplication-info.plist file to
If you open it up you will see the line: Main nib file base name. You must change the value to reflect your desired NIB file name
I had this problem, and it was a result of xcode continuing to copy previously compiled xib's - even though the source file was deleted, the build cache wasn't. Product > Clean and then recompiling solved it.
I just had this issue, just delete the app from the simulator.
Then do a clean on your project.
In xCode,
go to the Product menu,
select Clean.
Or just press Shift+Command+K!
I ended up recreating the xibs from scratch and that worked. Very frustrating.
you can try to modify your XIBs a bit, so xCode will detect a modification through the last modified date in file system. then it will load the xib from its actual path, an not from xCode cache.
I had the same problem, but i solved it by changing the datetime of my system to today. And re-saved the xib. I was testing the local notification.
Just an assumption, not sure if that really caused it: I finished a XIB that worked fine in the simulator and on an actual device. I then changed it to be localised in Xcode 4.5.1. The changes I did after that were not synced to the device until I manually deleted the app from the device and reinstalled via Xcode.
Deleted derived data, cleaned project and build. Old xib was magically removed. :D

Resources