Archive Page 2
Failed tests for architecture ‘i386′ (GC OFF)
I’m setting up unit testing in my current project (following Apple’s pretty-much excellent directions) and keep running into this mysterious “Failed tests for architecture ‘i386′ (GC OFF)” that nobody on the entire internets knows how to solve.
Turns out you need to adjust your build configuration before you set the test host and bundle loader. Set that bad-boy to “Debug”!

Remote Version Control with Subversion and Xcode
I split my development time between my MacBook and iMac, so I’ve been using some form of source control for the last few months (previously to that I was copying the files back and forth manually… ugh).
Up until last month I was using iDisk and Mobile Me to keep things straight. This actually works pretty well, which is why I kept using it for so long. Turn on iDisk sync and you’re given a new web-based drive on your desktop. Store your projects in there and they’ll always be up-to-date, no matter where they’re stored.
I had a few problems with this setup, thought.
- iDisk doesn’t handle symlinks well. This didn’t make any difference to my project, but some of the sample code I’d download wouldn’t work when it was running from the mounted iDisk volume.
- References to bundle resources are flakey. I never did figure out what caused this. Loading images from files worked fine, but trying to load sample data from an .XML file was completely broken, unless I stored the file somewhere besides the mounted iDisk volume. Since the file was small and never changed I got around this limitation by storing it on the Desktop on every computer I used, but it was still a janky solution.
- Xcode snapshots are broken. First, snapshots didn’t move from computer to computer, so if I made a snapshot on my laptop, it wouldn’t show up on my desktop. Second, the snapshots didn’t seem to persist when the project was stored on the iDisk volume.
I probably could have overcome all these issues with some effort, but why not save myself the headache and do proper SCM with subversion? Since it already has built-in Xcode support, I figured it’d be a breeze to set up. And for the most part it was.
The instructions I followed were from Jeff LaMarche and his excellent iPhone Development blog.
The helped me set up the repository, but didn’t go quite far enough. Since I’m working from two machines at the same time1, I need to be able to access my code from whichever machine I’m on. Most tutorials out there seem focused on either setting up local repositories, or setting up shared repositories on OS X Server, neither of which quite give me what I need.
Creating the Shared Repository
Since subversion is installed in OS X by default, setting up the repository is simple. These instructions are ripped from from Jeff’s blog. Open up Terminal and run the following commands.
cd /Users/Shared mkdir subversion cd subversion mkdir HelloWorld svnadmin create HelloWorld chmod -R 777 HelloWorld
Setting up Remote Login in OS X
In order to securely access your repository remotely, you’ll need to turn on remote login in OS X. Navigate to the Sharing tab in Preferences and turn Remote Login on.
While you’ve got preferences open, find out what your computer’s local hostname is, you’ll need this later. You can find it in the text towards the top of the Sharing window, mine is Grover-Cleveland.local. By using this name to access your repository, you will be able to access the source even if the IP address of the server changes and you should be able to access it from outside your LAN if you’ve got Back to My Mac enabled with Mobile Me (I haven’t tested this yet).
Accessing the Shared Repository in Xcode
Open up Xcode. Hit Command-, to open Preferences. Navigating all the way to the right, you should see an SCM window. Click the “plus” sign at the bottom window to create a new repository. Give it a name, the name doesn’t have to be the same as what you set up earlier. Hit OK and create the new repository. In the URL box type the path to your subversion repository like so:
svn+ssh://username@your-computer.local/Users/Shared/subversion/HelloWorld
where username is your current login and your-computer.local is the address of your computer that we located earlier. For your first connection you’ll be prompted to add the SSH key and Xcode will ask to use your confidential information. Go ahead and let it, and you’ll be set!
Read through the rest of Jeff’s post to get some more details on using Subversion and Xcode, or read Apple’s documentation if you’d really like to go in-depth.
After a few weeks of using this system, there is no doubt that it makes the process of working on code from two different machines much more seamless. The one problem I’ve been having, and I’d be grateful if anyone knew a solution to this, is that the Commit All Changes… command will not work for me. I’ve got to go through, select all the modified files and commit them in batches. In order to commit the .xcodeproj file I need to use the SCM Results command to browse inside the .xcodeproj package and manually commit the files it contains. Vexing…
Anyway, I hope this helps some people!
Edit: I’ve had some problems with the following error, Error: 155005 (Working copy not locked; this is probably a bug, please report). After ignoring it for a few months and finally trying to figure out what’s wrong, I realized that you need to delete the “Build” directory from your repository after you delete it. After this you should have no problem doing full project commits from the menu bar.
Footnotes:
My Sister: Funniest person I know
I take 2 types of naps. A lazy nap and a serious nap. The lazy is just how it sounds, no time limits just pure relaxation. The serious nap is more stressful. I have an alloted time that i must finish by and i first have to rid my room of distracting qualities such as the cat and phone. My life is very difficult, obviously.
Square America
Collection of slightly creepy animated 3D images.
(via shane lavalette)
NSPersistentStoreIncompatibleVersionHashError
Man. This error has been driving me nuts for a few days now. I’ve got my iPhone app up and running, everything works great until I try and run a
[managedObjectContext save:&error]
Without saving everything works just fine (though it doesn’t restore data when I restart, obviously). Whenever I try and save, though, I get the following error.
This NSPersistentStoreCoordinator has no persistent stores. It cannot perform a save operation.
After finally looking in what turned out to be a pretty obvious place, the declaration of the Persistent Store Coordinator in the App Delegate, the default code generated by XCode doesn’t do any error handling. Here’s what I replace it with:
if (![persistentStoreCoordinator addPersistentStoreWithType:NSSQLiteStoreType configuration:nil URL:storeUrl options:nil error:&error]) {
if ([error code] == NSPersistentStoreIncompatibleVersionHashError)
NSLog(@"Persistent Store Incompatible Version error. Please check %@", storeUrl);
else {
NSLog([error description]);
}
}
Check it. Turns out that changing your data model after you’ve already run the code once will render your database inoperable. Of course, there are techniques to upgrade your database to the new model, but at this point I don’t care. Delete the old database and next time you run the code, everything will move through smoothly, and your new database will be saved.
Cock Cock Train
In its defense, it does look pretty fun.
(not especially safe for work)
Old Growth Media and the Future of News
Great speech by Stephen Berlin Johnson at SXSW, posted here in full.
If only there were some institution that had a reputation for journalistic integrity that had a staff of trained editors and a growing audience arriving at its web site every day seeking quality information. If only…
Of course, we have thousands of these institutions. They’re called newspapers.
The whole thing is worth a read, but this conclusion is spot-on. As the web expands further it will become harder and harder for even the web-saavy to distinguish the crackpot from the reliable reporter. I think we all have some crazy friend who sends us links to blogs “proving” that Obama is an anti-American Muslim bent on destroying the United States. As more and more folks get online it’s only going to get more difficult for people to differentiate between reality and bullshit.
Comcast doesn’t get paperless billing
Seriously guys… Thanks for letting me know via email that I have a new bill, but it doesn’t do me much good if you don’t tell me what the bill is.

The best part is that their Bill View system is down, so logging in doesn’t do me any good, I still can’t find out how much the bill is. Thanks for nothing, guys.




