iOS Archives

These posts are syndicated from my iOS Dev Diary over at pinkstone.co.uk.

The format is slightly different with more code snippets and less explanations. I had originally designed it as a notebook in iOS Development – now you can follow along if you’re interested.

How to open a URL in Safari programmatically

Instead of loading a URL into a UIWebView we can also launch Safari to display it: UIApplication *mySafari = [UIApplication sharedApplication]; NSURL *myURL = [[NSURL alloc]initWithString:@”http://www.mydomain.com”; [mySafari openURL:myURL]; The method returns a BOOL value which will feed back if this operation was a success or not: if (![mySafari openURL:myURL]) { // opening didn’t work } […]

How to use iCloud key value storage

Storing small bits of info in iCloud is very similar to using the local NSUserDefaults device storage. The only difference is that your App ID needs to be enabled for iCloud in iTunes Connect and that you need to enable it in your project: Here’s how you save data to iCloud (from a text label): […]

When Xcode 4.5 suddenly stops running your app on a device (could not launch app)

I’ve had this problem that Xcode 4.5 would run my app fine in the simulator, but didn’t do so anymore on the device. Something about the “derived data folder was not found”. I checked, it was definitely there. Then I found this post on Stackoverflow to show some suggestions: http://stackoverflow.com/questions/11456312/xcode-suddenly-stopped-running-project-on-hardware-could-not-launch-xxx-app This solution worked for me […]

How to place an existing Xcode project under Version Control with Git (and ignore files you don’t want to track)

Usually when you create a new Xcode Project you can choose to setup a new Git repository. This is the best and easiest way to track your changes. However if you have a project that is not under version control you can create a Git repository retrospectively. This is fairly straightforward using the Terminal app […]

How to place an existing Xcode project under Version Control with Git (and ignore files you don’t want to track)

Usually when you create a new Xcode Project you can choose to setup a new Git repository. This is the best and easiest way to track your changes. However if you have a project that is not under version control you can create a Git repository retrospectively. This is fairly straightforward using the Terminal app […]