How to code using XCode 4.2 that support iOS 3.1.3

Actually, XCode 4.2 doesn’t support iOS 3.1.3 for simulator. But it can be used to deploy into iOS 3.1.3 device. I like to use XCode 4.2 to develop the code because it has better interface and ‘Interface Builder’ already built in there.

Here is what i did :

You may need to add iOS 3.1.3 sdk folder into XCode development folder

go to the target ‘Build Settings’, under ‘Deployment’ , set ‘iOS Deployment Target’ to ‘iOS 3.1’

on ‘Build Settings’, under ‘Architectures’, select ‘Architectures’ and click ‘+’ to add architecture, type in ‘armv6’

Where is MainWindow.xib ? In Xcode 4.2 the MainWindow.xib is not included for some of the project templates so we reconstruct the MainWindow.xib (thanks to Saurabh) :
a) File > New File , choose iOS > User Interface > Window, name it as ‘MainWindow’
b) Change the Class of File’s Owner to UIApplication
c) drop a Object from Library, change the class of that Object to ‘AppDelegate’
d) Bind delegate in File’s Owner to AppDelegate object
e) Control-Drag from the window outlet of the AppDelegate Object to the Window
f) Navigate to the project, and in the Summary tab, select MainWindow as the Main Interface

The template is done! You can continue your code (which is support to iOS 3.1.3) and debug it quickly using iPhone 5 Simulator.

After all of these settings, we can deploy it on iOS 3.1.3 device, and simulate it using iPhone 5 simulator.