Latest Articles

Use the navigation at the bottom to see older articles

How to save data in iOS

There are several ways to save and retrieve data for persistent storage (i.e. when you close your app and open it again). This is the easiest one I can think of: NSUserDefaults. Here’s an example that saves a text field from an IBOutlet. We’re saving both a string and an integer. We can use this […]

How to rename your iOS App in Xcode 4.x.x

Find the info.plist file (in the Supporting Files folder). Say your app is called MyApp, then you’re looking for a file called MyApp-info.plist Say hello to a scary list of key/value pairs In here, find the Bundle Display Name Change it from the default ${PRODUCT_NAME} to your title Build and see your title underneath your […]

How to add a Framework to Xcode 4.x.x

First head over to the top left corner of Xcode. Click on the Project Navigator to show all your files. Next click the big blue A icon right at the top of that list. Just right of it you see two headings: Project and Targets. Click on your app name under Targets. If this pane […]

How to send an email in iOS

This is tricky but doable. We’re using the MFMailComposeViewController protocol for this (don’t ask). This will open the mail app on your device. Older devices without mail sending capability will crash when you call this method so we’ll check before we do this. if ([MFMailComposeViewController canSendMail]) { MFMailComposeViewController *mailer = [[MFMailComposeViewController alloc] init]; mailer.mailComposeDelegate = […]

How to exchange data between View Controllers

If you have two view controller classes you probably want to exchange data between them. Thanks to two methods we can do that, provided one view controller is presented via a modal segue. Here’s how it works step by step. Imagine you had two labels on each View Controller. We’ll call them myLabel1 and myLabel2 […]

How to add a second View Controller

Here’s how you add a new View Controller to your project and switch to it via a segue: open a new Single View project add am Objective-C class and select subclass of UIViewController (we’ll call it MyViewController here) in MyViewController.h, import the other ViewController.h and vice versa, in ViewController.h, import MyVewController.h too head over to […]

I’m trying to read out the value of…

I’m trying to read out the value of a UISlider and put it into a UIProgressView. Not a problem, all I need is to divide my UISlider.value by 100 to get the correct output. So far so good. However, for some reason this statement does not work. I don’t know why: self.progressValue.progress = [[self.mySlider.value]/100]; Doesn’t […]