Detect iOS Version

Simple Way To Detect iOS6 vs iOS7 Note you can't use NSFoundationVersionNumber_iOS_7_0 if (floor(NSFoundationVersionNumber) <= NSFoundationVersionNumber_iOS_6_1) { // Load resources for iOS 6.1 or earlier } else { // Load resources for iOS 7 or later }      

Read More

Triggering Device Functions

Open a webpage in safari [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@”http://www.google.com”]]; Call a telephone number [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@”tel:0044-1234-567-890″]];

Read 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 Name it and ensure you change the extension from .c to .m Add to NewFile.h #import <UIKit/UIKit.h> Include Add import to the […]

Read More

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. .plist ApName-Info.plist is the info property list which contains a list of the key-value pairs. These values specify things like the icon to display on the home screen, if the app needs a persistant WiFi […]

Read More

Change Application Name

Up To Date Guide http://xcodebook.com/2011/04/renaming-projects/ Change Complete Project Name Menu > Project > Edit Active Target > Build tab Select ‘All Configurations’ from Configuration. Scroll down to the ‘Packaging’ group > Product Name Double click it and enter the new name. Build and run and the name has changed. Change The Displayed Name Changing the […]

Read 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) Switch Between .m And .h Files Hold CTRL + ALT and press UpArrow (windows keyboard – Option+Command for Mac keyboard)

Read More

Declarations

Declaring Variables Variables are declared inside { } Declaring Methods Methods are declared after }

Read More

.Overview

Project Files app delegate The starting point for the application – the app must have one. Manages a single top level UIWindow. application:didFinishLaunchingWithOptions Called right before the app is ready for the user – your chance to prepare the application for action before the user can do anything. xib doc window File's Owner An instance […]

Read More