Change Application Name

Up To Date Guide

http://xcodebook.com/2011/04/renaming-projects/ (more…)

Creating Simple Code Files

To create a .m and .h file pair to use for shared functions etc

Create Files

Menu > File > New File > Mac OS X > C and C++ > C File
(more…)

Declarations

Declaring Variables

Variables are declared inside { }

Declaring Methods

Methods are declared after }

Detect if device is iPad or iPhone


        UIDevice* currentDevice = [UIDevice currentDevice];
        if(currentDevice.userInterfaceIdiom == UIUserInterfaceIdiomPad)
        {
            NSLog(@"This is an iPad");
        }
        else
        {
            NSLog(@"This is an iPhone");
        }

Files

Project Files

.xib

MainWindow_iPhone.xib and MainWindow_iPad.xib contain the interface for your application. Double click to open in the interface builder.

(more…)

General Tips

Show Help For Something In Code

Hold CTRL + ALTĀ  and double click the name in your code (windows keyboard – Option+Command for Mac keyboard) (more…)

Getting App Version Number

Get Build Version Number

[[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleVersion"]]

Overview

xib doc window

File’s Owner

An instance of UIApplication – manages the event queue for your application

(more…)

Triggering Device Functions

Open a webpage in safari


	[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"http://www.google.com"]];

(more…)