English 中文(简体)
如何建立SOS 3和OS 4的仪器?
原标题:Any tips on how to create apps that run on iOS 3 and iOS 4?
  • 时间:2010-09-30 00:09:47
  •  标签:
  • iphone
  • ios4

Hey,
I m developing an iPhone application and my target is 3GS and 4G devices.
iOS 4 introduces methods thats deal with multitasking and newer methods to deal with foreground/background lifecycle events.
These new methods aren t available in iOS 3 which simply quits the app and doesn t run it in the background.
Any tips on how to create apps that run on iOS 3 and iOS 4?

问题回答

iPad方案规划指南(我知道,不是你所期望的)有一节是关于世界观的内容,表明你如何控制在运行时存在象征。 这也适用于你的问题。

Start here: https://developer.apple.com/library/ios/documentation/General/Conceptual/iPadProgrammingGuide/StartingYourProject/StartingYourProject.html#//apple_ref/doc/uid/TP40009370-CH9-SW3

我把我的所有系列文件都放在一个部分,然后把一个编汇的宏观(代号为你们汇编),并在每个职能范围内进行功能检查(一旦编辑,你的代码便没有坠毁)。

    //Define Logic for conditional code based on version of iOS
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 40000
- (void)applicationDidEnterBackground:(UIApplication *)application {
    //SPECIAL CASE:For OS versions before 4.0, background processes are not supported
    if (backgroundSupported) {
         <IOS4 CODE GOES HERE>
    }
}

- (void)applicationWillEnterForeground:(UIApplication *)application {
    if (backgroundSupported) {
        if (backgroundSupported) {
         <IOS4 CODE GOES HERE>
    }
}

- (BOOL)checkBackgroundSupported {
    UIDevice* device = [UIDevice currentDevice];
    backgroundSupported = NO;
    if ([device respondsToSelector:@selector(isMultitaskingSupported)])
        backgroundSupported = device.multitaskingSupported;
    return backgroundSupported;
}
#endif




相关问题
Code sign Error

I have created a new iPhone application.I have two mach machines. I have created the certificate for running application in iPhone in one mac. Can I use the other mac for running the application in ...

ABPersonViewController Usage for displaying contact

Created a View based Project and added a contact to the AddressBook using ABAddressBookRef,ABRecordRef now i wanted to display the added contact ABPersonViewController is the method but how to use in ...

将音频Clips从Peter改为服务器

我不禁要问,那里是否有任何实例表明从Peit向服务器发送音响。 I m不关心电话或SIP风格的解决办法,只是一个简单的袖珍流程......

• 如何将搜查线重新定位?

我正试图把图像放在搜索条左边。 但是,问题始于这里,搜索条线不能重新布署。

热门标签