Any tips on how to create apps that run on iOS 3 and iOS 4?

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?

-------------Problems Reply------------

The iPad Programming Guide (I know, not what you'd expect) has a section on universal apps that shows you how to check that symbols exist at runtime. It applies to your question as well.

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

I put all my ios4 functions in one section, then wrap a compiler macro(so xcode lets you compile) around them and have functional checking inside each function(so once compiled, your code runs without crashing).. for example

//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

Category:iphone Views:7 Time:2010-09-30
Tags: iphone apple ios4

Related post

  • Iphone app wont run after upgrading to iOS 4.2 2011-02-17

    After installing Xcode 3.2.5 iOS 4.2 an app that was perfectly working stopped working. I have seen that this has happened to others but cant understand how to solve it. My questions are: 1. How can I know where it is crashing? 2. What can I do to be

  • App not running in simulator for iOS 5 2011-10-17

    When I run and build my application for the iOS 4.3 simulator everything works fine. Unfortunately when I run it in a iOS 5 simulator I get the following error: It pauses and doesn't go further. The weird thing is that when I run it on my iPhone, whi

  • creating app looking like ICS "Phone" app 2012-01-28

    I am pretty new at all this android java development to create apps but after a series of tutorial I feel more confident. I have ideas for an app in which the layout would be like the phone app in android 4.0.3. Let me explain : my app would.consist

  • Creating apps with InDesign 2014-07-06

    Hi I'm an Indesign user, and I'm considering taking a course on developing apps with InDesign. My understanding is that, in order to use this for work, we'd have to buy a license to use with DPS. How much does something like that cost? Adobe buries t

  • Looking for a google-analytics-style map creating app or api 2008-12-29

    I am looking for a google-analytics-style map creating app or api based on visitor IP addresses, any suggestions? thanks, nicoperez --------------Solutions------------- Did you take a look at the Google Visualization API? Specifically, the intensity

  • .net - failed to create app domain 2010-06-09

    just looking for abit of guidance here if possible. I recently downloaded a .net component for VS 2008 to handle sftp. After struggling with it for a day i uninstalled and deleted it. When going back into VS 2008, any of my previous projects have thi

  • Creating apps that embed into gmail 2010-08-17

    I can't seem to find the developer center where it tells you how to create apps that embed into gmail. BTW, when you embed an app into gmail, can you read users emails somehow? Isn't this a privacy issue or you just have to trust the app developer? -

  • Grails error executing create-app 2010-09-01

    I am using jdk1.6 and grails 1.3.4. I have set the JAVA_HOME,GRAILS_HOME and PATH variables following the instructions in the grails.org site. When I execute the create-app command I get the following error: C:\grails\grails-1.3.4>grails create-ap

  • rebar: error exit on create-app: {crypto,start,[]} 2011-01-20

    I followed the instructions here, to the letter. I then ran the instruction to create an application project structure, and got the following error. $ ./rebar create-app appid=myapp Uncaught error in rebar_core: {'EXIT', {undef, [{crypto,start,[]}, {

  • Customize Grails create-app 2011-07-01

    I want my Grails Apps to have a different Look&Feel than the standard Grails one. As I didn't want to modify every single application, I would like to customize the project creation (grails create-app) After googling a bit around I found the poss

  • How to create app like iBooks 2011-08-03

    Is it possible to create app like iBooks? I want to create app like iBooks. I want to know how i can curl the page of pdf. Please share your ideas to create this app. Thanks --------------Solutions------------- Check out this library, might be a good

  • How to create apps for lower versions in QtCreator? 2011-10-12

    I have QtCreator2.3.1 based on Qt4.7.4. In it I have build options for: Qt4.7.3 for Symbian^1(QtSDK)(as i understand s60 5th edition corresponds to Symbian^1), Qt4.7.3 for Symbian^3(QtSDK), Qt4.7.4 for Symbian Belle(QtSDK) My mob is s60 3rd edition,

  • Create App using PHP or JavaScript 2011-10-20

    Simple question... is it possible to create a new app with php or javascript? Not the app content, but the real app (site url, canvas page, name, secure canvas, etc) and then retrieve the app id and secret for the newly created app. The goal is to be

  • Dynamically creating App.config with connection string if App.config does not exists in Application-Data folder 2011-10-24

    I need to do my code the following task. I wrote some code as below, but I am getting error while setting connection string. Looks like it does not have set property. Check if App.config is exists in user’s “Application Data” folder. If does NOT exis

  • How to create app store build from xcode 4.2? 2011-11-11

    I have developed the universal app using xcode 4.2. It is the time to upload the app to iTunes connect(Submit to App Store). Last time i have submitted and created app store build from xcode 3.2.5. Now, i really confused that to create an app store b

  • How to create app with 2 view for different orientations? 2011-12-15

    How to create app with 2 view for different orientations? For landscape and portrait, i need 2 XIB. Own for each orietation? --------------Solutions------------- You can react on orientation changing with willRotateToInterfaceOrientation: Create an a

  • Xcode: how to create .app from a cocoa project? 2012-01-24

    I have a cocoa project and I would like to create .app package for that. Maybe it's a silly question but I was unable figure it out. --------------Solutions------------- In Xcode, in the menu bar. Product->Archive When that is done it should take

  • Creating apps on facebook automatically 2012-03-23

    Does anyone know of a way programmatically to add/remove applications? i.e to replicate the function of the Developer App? I can see a graph request to obtain the details of an app, but nothing to set those details. All thoughts gratefully received..

  • Can company page accounts create apps? 2012-05-29

    Can I create or manage a Facebook app via a 'business' account? When I try to access https://developers.facebook.com/apps when logged in as a business account it redirects me back to my homepage and won't let me create an app. Context: A business / a

Copyright (C) dskims.com, All Rights Reserved.

processed in 0.202 (s). 11 q(s)