简体   繁体   English

使iPhone应用程序与iOS 3兼容

[英]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. 我已经使用xcode 4开发了一个iPhone应用程序,它与iOS 4.3兼容并且可以在iPhone 4设备上流畅运行。
My question is how to check whether my application is compatible with iOS 3 or not. 我的问题是如何检查我的应用程序是否与iOS 3兼容。
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. 我没有任何运行该应用程序的iOS 3设备,因此唯一的解决方案是检查模拟器是否与iOS 3兼容,但是我没有找到任何在iOS 3模拟器上运行该应用程序的选项。 Any suggestion how to install SDK for iOS 3. 关于如何安装iOS 3 SDK的任何建议。
Thanks 谢谢

The only way to be sure of compatibility is to borrow or buy a device running iOS 3 for testing. 确保兼容性的唯一方法是借用或购买运行iOS 3的设备进行测试。 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? 如果您找不到在任何地方仍在运行3.x的设备,甚至只是借了一个小时,为什么还要担心如此稀有的兼容性呢?

Here's my checklist for iOS 3: 这是我的iOS 3清单:

  • make sure that your app runs fine on slow CPU and less memory. 确保您的应用在CPU速度慢和内存少的情况下可以正常运行。
  • support armv6. 支持armv6。 add armv6 to architectures, remove armv7 from required device capability, and disable thumb on armv6 if your compiler has code generation bug. 如果您的编译器有代码生成错误,则将armv6添加到体系结构中,从所需的设备功能中删除armv7,并禁用armv6。
  • don't use ARC, whick is not (officially) supported on iOS 3. 不要使用ARC,iOS 3不(正式)支持whick。
  • check for existence of newer method (with respondsToSelector:) or class, instead of checking the OS version in most cases. 在大多数情况下,请检查是否存在较新的方法(使用responsToSelector :)或类,而不是检查操作系统版本。
  • don't use gesture recognizers which did exist on iOS 3 but were private API, and lack important methods. 不要使用在iOS 3上确实存在但是私有API且缺少重要方法的手势识别器。 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.) 如果使用块,则需要动态链接系统库,并且它需要iOS 3.1(我听说iOS 3.0不支持动态链接。)

Here is an example application:didFinishLaunchingWithOptions: method. 这是一个示例应用程序:didFinishLaunchingWithOptions:方法。

- (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;
}

Tap the project, tap your target, tap Summary, set your Deployment Target to 3.x. 点击项目,点击目标,点击摘要,将部署目标设置为3.x。 Then the Scheme pulldown in the top of XCode will show you options to run it in the 3.x simulators. 然后,XCode顶部的Scheme下拉菜单将为您显示在3.x模拟器中运行它的选项。

iOS开发人员中心上,有一个指向Xcode 3的下载链接。其中可能包括iOS 3。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM