Manish Agrawal
Manish Agrawal

Reputation: 11027

Make iPhone app compatible with iOS 3

I have developing an iPhone application using xcode 4 which is compatible with iOS 4.3 and runs on iPhone 4 device smoothly.
My question is how to check whether my application is compatible with iOS 3 or not.
I do not have any iOS 3 device to run the app so the only solution is to check the compatibility for iOS 3 is simulator but I have not found any option to run the app on iOS 3 simulator. Any suggestion how to install SDK for iOS 3.
Thanks

Upvotes: 2

Views: 1583

Answers (4)

hoshi
hoshi

Reputation: 1707

Here's my checklist for iOS 3:

  • make sure that your app runs fine on slow CPU and less memory.
  • support armv6. add armv6 to architectures, remove armv7 from required device capability, and disable thumb on armv6 if your compiler has code generation bug.
  • don't use ARC, whick is not (officially) supported on iOS 3.
  • check for existence of newer method (with respondsToSelector:) or class, instead of checking the OS version in most cases.
  • don't use gesture recognizers which did exist on iOS 3 but were private API, and lack important methods. you need to handle touch events manually.
  • if you use blocks, you need to link the system library dynamically, and it requires iOS 3.1 (I've heard that iOS 3.0 doesn't support dynamic link.)

Here is an example application:didFinishLaunchingWithOptions: method.

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease];
    self.viewController = [[[ViewController alloc] initWithNibName:@"ViewController" bundle:nil] autorelease];

    if ([self.window respondsToSelector:@selector(setRootViewController:)]) {
        self.window.rootViewController = self.viewController;
    } else {
        [self.window addSubview:self.viewController.view];
    }
    [self.window makeKeyAndVisible];
    return YES;
}

Upvotes: 2

hotpaw2
hotpaw2

Reputation: 70733

The only way to be sure of compatibility is to borrow or buy a device running iOS 3 for testing. The Simulator, even an old one, is not accurate enough to ensure compatibility.

If you can't find a device still running 3.x anywhere, even just to borrow for an hour, why bother with compatibility with such a rarity?

Upvotes: 2

Rayfleck
Rayfleck

Reputation: 12106

Tap the project, tap your target, tap Summary, set your Deployment Target to 3.x. Then the Scheme pulldown in the top of XCode will show you options to run it in the 3.x simulators.

Upvotes: 1

Tom van der Woerdt
Tom van der Woerdt

Reputation: 29985

On the iOS developer center there's a download link to Xcode 3. That one might include iOS 3.

Upvotes: 0

Related Questions