ios5 storyboard application for ios4 - iphone

I am creating a new application and am planning to start with ios5 as it supports storyboards. However, I am not sure if the app that is compiled with ios5 runs on ios4 as we are looking at kind of a forward compatibility. Since ARC is a compile time feature, I am guessing that is not a problem. However, the calls like prepareForSegue or performSegueWithIdentifier depend on ios5 api's. However as the code is built, I am wondering if the executable assembly is capable of running on ios4 devices. Can some please shed some light on this?
Also, if the answer is a strict NO, do I need to go back with traditional NIB's for the app? Are there any selective features that may work and that may not?

The UIStoryboardSegue is iOS 5 only, thus the app will not run on iOS 4. Since it not a compile time feature, you will have to go back to using NIB's.
Any methods you use that are only available in iOS 5 will not work in iOS 4, thus meaning that any methods that deal with the storyboard will not work in iOS 4.

Related

Targeting iOS version, and which features will be available

I am learning iOS development. And I had couple of questions, hope people don't mind
answering them here.
I was reading a chapter about ARC in a book. It seems nice. I've heard it is for iOS 5. Now, my question is, if I want my app to be available for iOS4 - does it mean I can't use ARC? (that would be a shame).
Also, I am not sure yet, for which version of iOS I should target my app. How is this reflected on my code? For example, I suppose if I target iOS5 I can't use features of iOS6 right? But if I target iOS6, then my app won't run on iOS4?
Any tips in this direction appreciated.
I agree with David's comment and you should concentrate on iOS 6, but for information and future you would construct your app using a combination of weak linking and respondsToSelector: so that your app can use features of newer versions of iOS but still be compatible with older versions.
NO Arc can be only for iOS 5 or later but if you want your older code to be ARC enabled then you can Refactor->convert to ARC for that file. Also if you want your code to be Arc disabled then for each file you can write down "-fno-objc-arc" in build settings.
Ya new features wont be compatible for your older versions. So make sure you should be very specific for your requirements. The requirements of your App will make you conclude which iOS version you should target.
Hope this helps :)
You can make individual file non-arc as per your requirement in Project.
It is very simple way to make individual file non-arc.
Follow below steps :
Disable ARC on individual file:
Select desired files at Target/Build Phases/Compile Sources in Xcode
Select .m file which you want make it NON-ARC
PRESS ENTER
Type **-fno-objc-arc**
you can use ARC in ios 5 and above but not in IOS4.
If you targeting your app to IOS 5 then you will be able to use ARC as well. If u target it to iOS 5 then it will work on IOS 6 as well (only the deprecated features wont work on iOS 6).

Do I need to keep "recompiling" my iPhone app code everytime apple releases a new iOS version?

New here guys but have got a genuine problem. I have an iPhone app that was developed using SDK4. With apple introducing the new iOS version 6, does my code need to be recompiled on the new SDK to make it compatible with version 6?
Right now it crashes on iOS6. Also, do I need to do that everytime apple brings out a new version? I wonder every other app on earth already does that ?!
The problem with major iOS upgrades is method deprecation. It may happen that some parts of your code relies on methods that are not supported in iOS6. When this happens you should first check for API changes then recompile it with the latest API. If your code base works fine with iOS6 than there is no need for recompiling it, but unfortunately that doesn't seems to be your case.
Sometimes you don't need too. Most of the time, Apple publishes updates for libraries, so sometimes the old code is not compatible anymore. You have to recompile it, or you'll find issues.
For example I had a working app on iOS 5. With the iOS 6 update, I had to refer some code new because the app crashed with SIGABRT. Before iOS 6 it was working fine. Through Xcode's Debugger, most of the time finding issues is not hard work.
I've found that most of the time a crash will be caused by an existing bug in my application that I wasn't aware of. Subtle changes revealed it. It is rarely just a question of recompiling, but of fixing that bug.
Just recompiling can be dangerous. Apple can (and does) detect what version of the development tools your app was compiled with, maintains some behaviour that will keep your app running. Update, and you'll get the new behaviour instead.
I didn't have to recompile mine just for the sake of IOS6. They worked fine. But I had to adjust for 4" iphone 5 screen.

Will my app work with a new iOS?

I have made an app for iOS 5.1..
Will the app work with iOS 6 also? Or do I have do to any updates in the code or something?
Thanks!
Apple has good backward and forward compatibility so it should work with no problem
There are cases when you use some specific libraries that your app will need a resubmission
but 99% of the cases your app will just work good
One point to note here: is if apple will change the resolution of their next devices you may find some icons that are low quality (happend when iphone 4 was first release)
But regardless of that your app should work.
Usually the OS versions are backward compatible for the apps.

Is the use of storyboards in Xcode 4.2 production ready and recommended? (c.f. previous XIB methods)

Is the use of storyboards in Xcode 4.2 production ready and recommended?
That is, would iPhone/iPad developers that have used storyboards recommend (for native iPhone/iPad apps) to definitely use storyboards? Or are there some gotchas and issues still with the concept?
P.S. Also do storyboards assist in getting a Universal Application designed/working?
This depends, for the most part, on your target audience. The only potential deal-breaker is the fact that using storyboards requires you to set your app's deployment target to iOS 5.0 or later; a storyboarded app cannot run on any earlier version of iOS.
If you must cater to previous versions of iOS, you have to continue using individual nib files if designing your interface with Interface Builder. I'd also recommend sticking with whatever you're already using in your existing projects. (You can introduce storyboards into your existing projects in steps, but remember that they'll only work in iOS 5. There's a WWDC 2011 presentation that walks you through this process.)
For new projects, storyboards seem to be the way to go, as long as you're sure you won't need to deploy to previous iOS versions.
Also do storyboards assist in getting a Universal Application designed/working?
Not sure what you mean by "assist", but you have to create one storyboard of nibs for each device family. So one for iPhone/iPod touch, and one for iPad.
It would be interesting to know how much of the market you are missing out on by targeting only iOS 5. I have noted that there is a significant percentage of iPhone users who dont upgrade their iOS be it from iOS 3 to iOS 4 or even iOS 5 so any apps targeting iOS 5 will mean they can not download any app you create.
I started out using iOS 5 with storyboard and it's a great feature, but had to pull back and use xibs so that I get backwards compatibility. There's just too much of the market you will miss out on by only targeting iOS 5.
ARC is a great plus, and just for that feature alone I am happy with the transition to iOS 5. Not to mention the new CLGeoCoder class and JSON now included. Anyone who wants to use JSON API have a look at this great tutorial from Ray Wenderlich.

Does supporting multitasking in iOS 4 mean dropping support for iOS 3?

I can't find anywhere definitively, if you build an app against the iOS 4 SDK, to thus support multitasking, does that mean the app won't work in iOS 3? If not, how can you support iOS features like multitasking but still support iOS 3? I'm sorry if there are Apple docs on this, I'm happy to read them, I just can't find them. Thank you
You can build against a 4.x Base SDK, and set the Deployment Target to 3.x.
But you have to make sure not use any of the new 4.x APIs without checking for their availability first (or you will start to run, then crash as soon as you call one of those APIs on a device running 3.x). And you will need to test thoroughly on an actual device running iPhone OS 3.x since there is no simulator support for this kind of OS portability testing.
In some cases, converting a 3.x app to also allow what is called "multitasking" under 4.x is as easy as rebuilding the app using a new 4.x Base SDK, but leaving the deployment target where it was at 3.x, and adding an applicationWillResignActive: delegate to handle both suspend and potential termination.
No it does not. iOS 3 just ignores the delegate methods that get called.
However, if you try and launch a background task, you'll have to check for the API first, otherwise yeah, you'll not run on 3.