January 4, 2010
For some strange reason there is no way to specify a company name in XCode.
Most source code templates include __MyCompanyName__ in the comments. To change it, open terminal and type this command replacing __MyCompanyName__ with whatever you want:
(more…)
October 31, 2009
EXC_BAD_ACCESS. Debugging this one is on par with figuring out why the wife says “not tonight, honey.” And they are equally unfortunate situations.
Let’s see what we can do about EXC_BAD_ACCESS.
(more…)
October 30, 2009
I came across this issue when I received a UTF-8 encoded stringĀ from a URL. I was expecting the UTF-8 string to be automatically decoded, but then I realized that it’s probably not trivial to identify a UTF-8 string, so NSString doesn’t automatically do this for a reason. (Unfortunately, this realization came only after I’d been banging my head against the screen for an hour. Hence this post
There’s no method in the NSString API to decode a UTF-8 NSString directly, so first it has to be converted to a C string (gotta love those C strings.)
NSString *encodedString;
NSString *decodedString = [NSString stringWithUTF8String:[encodedString cStringUsingEncoding:[NSString defaultCStringEncoding]]];
October 29, 2009
I needed a quick way to encode an NSString to be used in a JSON object in an iPhone project. There are libraries to do this like TouchJSON, but I didn’t want to link a whole library to insert a string into a Facebook query.
(more…)
October 28, 2009
The OS X registration process can come up with some pretty stupid computer names like chuck johnson’s macbook. This will show up in the Terminal, on the network and it has a freaking single quote and spaces in it ?!
Here’s how to rename it to something that makes sense, like pink.
(more…)
October 27, 2009
Microsoft offers a tool to create a bootable USB stick (thumb drive? flash drive? floppy disk?) using a Windows7 ISO image, but if you purchased an educational/student copy of Windows7, it won’t work for you.
(more…)
October 18, 2009
Adobe Photoshop CS4 comes with a script that exports layers to files, but it adds layer numbers to the file names by default. After lots of manual renaming I decided to add an option to suppress the layer numbers.
(more…)
October 17, 2009
I’ve recently replaced the network card in my Acer Aspire One 250 netbook with a Dell DW1510.I had some trouble finding the drivers on Dell’s site, so I’m posting the info here.
(more…)
October 10, 2009
I’ve recently worked on an update to MeanPhoto. The project was originally done using the iPhone SDK 2.1. I made the new distribution build with the 3.1.2 SDK without any issues, but when I uploaded the binary on iTunesConnect, I got an error saying that the app was not signed with an Apple provisioning profile.
I was surprised because I did not change any build settings. When I looked at the code signing key, I didn’t see any of the installed provisioning profiles:

- no profiles showing up
The provisioning profiles should show up like this:

- provisioning profiles showing
I checked a bunch of things from my old post about code signing, but I could not fix the issue.
I opened the project.pbxproj file (located in the .xcodeproj folder) and saw that while the CODE_SIGNING_IDENTITY was set, the PROVISIONING_PROFILE key was missing in the Distribution build settings section:


- PROVISIONING_PROFILE missing
I created a temp project and selected the correct provisioning profile (in the new project I could select it with no problem). I opened the .pbxproj file from the temp project in a text editor (I use Smultron which is awesome) and copied the PROVISIONING_PROFILE setting to MeanPhoto’s .pbxproj:

- PROVISIONING_PROFILE set
The provisioning profiles still don’t show up in XCode, but the new build uploaded to iTunes without a problem.
May 21, 2009
Mercurial is awesome. Mercurial over SSH is even awesomer. Here’s a way to set it up on Windows using PuTTY.
(more…)