I wrote a code on IOS SDK 4.0 and tried running on a device which contains IOS 4.2. I am seeing a empty navigation view. What changes in my code I should do to run it on the target version of SDK.
It's very hard to say without having more information on the project and what technologies within iOS it makes use of. Is there anything in the release notes that sheds light on your problem:
http://developer.apple.com/library/ios/#releasenotes/General/RN-iOSSDK-4_2/
Might be worth checking 4.1 ones as well:
http://developer.apple.com/library/ios/#releasenotes/General/RN-iPhoneSDK-4_1/
Related
I am creating an iPhone project for iOS 5. I need to know if i can run the program in iPhone 4.3.3 and higher ?
Are you using anything in your code that was introduced with iOS 5.0 & newer? (such as storyboards)
If your answer is yes, then you can't run it on 4.3.3.
If no, then you can set the minimum required version to 4.3.X (and here's a tutorial you can use).
Here is a related question (and another one) that may help you out a bit more.
IIRC, you can configure the simulator in xCode to emulate an earlier version of iOS so you can confirm whether or not it will work on 4.3.3. Have a look at the build settings for your project, you can change the target O/S. I'm not sure all versions are available by default though. You might need to download other versions to test.
You said you are using ARC. ARC will work with iOS 4.x, but not iOS 3.x. So ARC will not be a problem. Based on everything else you said about not using storyboards and everything being coded, you should be okay. If you click on a method in Xcode it should allow you to bring up the documentation, and in the documentation it will provide the iOS version that it was released for. Make sure that this it iOS 4.3.3 or lower.
May be this will be silliest question but users are facing such problems.
Sorry for same.
I have made build on xcode 3.2 which has maximum IOS 4.3 and uploaded on itunes.
Now users which are downloading application having IOS 5.0 says that application is getting crashed or vanished.
So, just want to ask that build made on xcode 3.2 runs on IOS 5.0
Please help.....
Thanks a lot....
The short answer is that you have a bug in your app.
An app compiled for iOS 4.3 should work just fine. However, as with any update to the operating system, ambiguities in API calls are tightened, undocumented behaviours vanish and some APIs become deprecated. Deprecations won't cause problems (yet), though both of the others might.
For this reason you should be testing with new versions as they become available.
I am writing an iPhone app in which I want to support the largest user base possible at this point in time (with minimal pain), so I decided that targeting IOS 4.3+ would be a good subset of users for my audience.
I started working in XCode 4.2, but reverted back to XCode 4.1 when I realized that the project templates had changed and everything seemed very intertwined with storyboarding, ARC, etc.
I have built out my application to the point I actually want to test on my device, which has iOS5 installed. When I attempt to use it though, I get this message as soon as I click 'use for development' in Organizer/XCode:
The project's build settings look like this:
My Question Is This: How do I get this application, built in XCode 4.1, to run on both iOS 4.3 and iOS 5 phones?
Are iOS SDKs not backward compatible? I come from Android development in which a less than current SDK will generally work on a newer SDK - is this different in the iOS world? And if so, how is this handled typically?
Any direction on how I should proceed would be greatly appreciated.
You can go ahead and open your app in Xcode 4.2 and it should still work. I've been working on a particular app since Xcode 3.x days and I'm nearly done, chugging along in Xcode 4.2 right now. It shouldn't be a problem. If you want to work with Xcode 4.1 you will be fine, but you won't be ale to use new features introduced in iOS 5.
There are several aspects of "cross-version" development to note.
Testing: You can only test on version of iOS that are included with your SDK, or that are installed on physical devices that you may have. The SDK generally comes only with the latest iOS, sometimes the previous one is included as well, but since Xcode 4 was released, the older SDKs have been progressively deprecated with each release. This is not to say that your app which is linked against the iOS 5 SDK won't run on older versions of iOS. It just depends on how you implement new features.
Features: In order to support older versions of iOS properly, you want to make sure that you don't implement new features without properly checking for the existence of classes, methods, and properties that were introduced in the newer versions of the OS. Unlike Android, you don't have to worry about a million hardware configurations. ;-)
Weak Linking: To support a new feature and still be compatible with older versions of iOS, you need to weak link against frameworks that you are using to implement new features. You can read more about that in the Apple Documentation on Weak Linking.
Deployment Target: The setting that prevents the app from loading on older devices is called the "Deployment Target". If you set this to 3.1.3, then your app will run on iOS 3.1.3 and higher. Remember that if you don't code the the proper version checking, your app may break.
ARC: You can choose to enable or disable Automatic Reference Counting when you create the project. ARC scans your program at compile time only, not at runtime, it doesn't break the app on older versions of the OS.
You need the latest version of XCode and the iOS SDK to install your apps onto your iOS 5.0 phone. That doesn't mean the inverse is true -- you don't need the same version of iOS on your device that you have installed on your computer.
Hope this helps!
You can use the latest SDK and simply set the "IOS Deployment Target" version to 4.3 in the project build settings.
XCode 4.1 doesn't support iOS5 in the sense that Xcode package doesn't contain the iOS5 SDK. So you must return to Xcode 4.2 and target your project for iOS 4.3 (you can also target it for iOS 4.0 with this Xcode version, but you will not be able to simulate it; you can even download older iOS 4.x package versions from the Xcode preferences menu if you really need to simulate them in your device).
You can opt-out of ARC if you want, this choice is given to you when you create the project, so don't worry; but consider that ARC does its magic at compile time only, not at runtime, so your backward compatibility will be kept if you decide to use this technology. Finally if you don't want Storyboard just pick the Empty app template and it will simply put in your project only the basic files. From this template you can create any iOS app, this is the approach I normally follow.
We are about to issue version 4.0 of our iPhone app and have had some complaints recently that previous versions are only available from iOS 4.1 plus. I know that to change this I can set my Deployment Target (In Project>Build) to iOS 3.1. However, I've run through the app on an emulator and again on my iPhone (uses iOS 4.2) but I'm not able to test on anything older as everyone here has the same iOS or 4.3. Can I safely assume that just by changing the Deployment Target and testing the app on later models that the app will run safely on later versions like 3.1.
We are familiar with the reason why people with older iPhones wont upgrade to iOS 4.0 and above, so we would like to accomodate them but not if it means the app is unsound and we have no way of testing it.
No, just because it compiles and runs on newer version of the SDK does not mean that it will work on older versions. If you're using features that are only available in iOS 4+ you'll need to check for their existence before using them; your app will crash otherwise.
There are some subtleties that you'll probably miss the first time too (or at least I did). In short, there's no real alternative to testing.
for the problem you have you need to install older versions of xcode having ios 3.0 support and you need to check whether it's working on the same or not as there are lots many changes in os 4.0 and above so it's definite that the application will not work with the ios 3.0, 3.1 available device and it will crashed.
Just install older version of SDK and test on simulator , if works then fine else you need to make code according to ios version 3.0 and ios version 4.0 in your code by differentiating the os and run the code accordingly.
My app was built with SDK 2.2.1 version even before 3.0 beta appear.
User going to install my app to the last iPhone 3Gs with 3.0 FW version. Will my app behave differently with last iPhone? Will items described here (3.0 OS Release Notes) influence to my app which was build with 2.2.1 SDK?
For example Apple doc tell:
FIXED: UINavigationController won't resize content view automatically if barStyle is changed to/from UIBarStyleBlackTranslucent.
But my app use this style and I saw content view resize before with iPhone 2.2.1 OS...
What does it technically mean when I select 2.2.1 or 3.0 SDK as active in XCode for my project and build? Does SDK corresponded libraries linked statically?
Thank you.
When you select an active SDK in XCode, it essentially chooses the headers to compile against. The libraries are linked dynamically, so when you run an app built against 2.2.1 on a device running 3.0, it will have the 3.0 library behaviour.
For the specific fix you quoted, it may be that content failed to resize under certain circumstances which never affected you in the first place. But the long and the short of it is that you won't know exactly how your app behaves under 3.0 until you try it.
Selecting an active SDK in Xcode tells the compiler which version of Apple's libraries and frameworks to build against. If you're using code that Apple changed or marked bugfixes on between 2.2.1 and 3.0, then yes, you will see different behavior in your app.
For example, between iPhone OS 2.2.1 and 3.0 Apple deprecated the UITableViewCell initWithFrame: initializer method. In 2.2.1, code that created table cells using this initializer worked fine. They will still work in 3.0, but you will receive a deprecation warning from Xcode, and you should update your code because Apple may remove deprecated pieces of the framework at any time.
Other changes are more behavioral, like the one you mentioned. If your application relied on a content view resize when you change the bar style, and that resize no longer happens, unexpected things may occur in your app.
The best approach to take is to build your app in 3.0 and test it thoroughly. Go through the compiler warnings and update code as necessary, then look at other changes Apple made and where you use those bits in your code.
Side note: As I understand it, Apple is no longer accepting applications into the App Store that have not been tested on 3.0 (nor have they been for some time).