Iphone - deprecated funcions... will they crash the iphone? - iphone

I am dealing with an old code designed for iPhone OS 2.0. In this code I have some instructions that we deprecated on iPhone 3.0.
I am not willing to change the version because I have many customers, specially on iPod Touch, that are still using 2.0. If I update the instructions they will be unable to continue receiving the updates.
The application is compiled for 2.0 and always have been like that.
I have submitted a new version for Apple, where some bugs were corrected and new functionality was added. I have always sent this app to apple and they never complained. Now they rejected the application telling me that it is crashing under OS 3.1.3.
I've followed their instructions but I don't see any crash and the part of the code that uses the "deprecated" function works perfectly on 3.1.3.
Compiling the project for 3.1.3, I see a yellow warning on Xcode telling me that one instruction was deprecated on 3.1.3.
The big question is: will this instruction work on 3.1.3 and should I ignore this warning?
Can this make the iPhone crash?
In my mind, all new versions of the iPhone OS keeps back compatibility with older versions, so, as I think, any application compiled for 2.0 will run on 3.1.3 and all versions up.
As you see, I have tested this on 3.1.3 and the application works perfectly.
How can that be? Any ideas?
thanks for any help.

Deprecated calls are designed to work in the OS release that they became deprecated in, but stop working in some (undefined) future OS. The deprecation is a warning to developers: Hey, you should change your code, this WILL break in the future. It's a way to update the API-base without breaking everyone.
In summary, you're okay to use these calls now, but you'll want to edit the code should you ever decide to ditch 2.x operability.

Related

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.

Does build made on xcode 3.2 runs on IOS 5

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 using Xcode 3.2.5. I have iAds running. Confused about about targest, iOs versions

Trying to keep up with the curve. I'm reading almost too much and is sending me in a tail spin. Is there a one stop link which will tell me what my target should be to run my app on all platforms based on what frameworks I have included? I make heavy use of Mapkit, and want to include iAds. My current apps seem dead on 3G.
Does Apple force you to support only the latest iOS? I have no problem with that, but not sure if someone who has and ancient 3G, how do I tell them, NO I don't support your phone, please upgrade?
Set your project's base SDK to the latest version of the SDK. Set the deployment target to the oldest version of the OS that you plan to support. You can use features introduced in versions later than your deployment target, but you'll need to check for them before you use them, else your app will crash.
Read the release notes for each version of the OS to get a good idea of what features were introduced when. In fact, make it a habit to read the release notes thoroughly each time a new version comes out.
iOS 4.2 runs pretty well on an iPhone 3G, so there's no need to drop support for the 3G anytime soon. If your apps currently don't work on the 3G, fire up your debugger and figure out why. What version of iOS are you running on that device? Where does it crash? This is typical debugging stuff.

NSXMLParserDelegate and iPhone SDK 3.1.X

I have an app on the store which was built for 3.1.2, but which was crashing under 4.0GM. I've fixed the crash problem using Xcode 3.2.3, but was also getting warnings that such-and-such class did not implement NSXMLParserDelegate. I added to the headers and everything seemed fine. I've now submitted the app and it's waiting for review. This latest version was compiled with base SDK of 4.0, and a deployment target of 3.1.2.
The problem I have is that this morning I opened up the project in Xcode 3.2.2, and when building against base SDK of 3.1.2, I'm getting compile errors saying that NSXMLParserDelegate does not exist. Does this mean my app that is waiting for review is going to crash under 3.1.2 devices? This is strange, because my beta testers who are using 3.1.3 and I think 3.1.2, said the app works fine. Shouldn't it crash if it can't compile against base SDK of 3.1.2?
I think this should be ok to discuss in regards to the 4.0 NDA, as my problem is specific to 3.1.X.
First of all, the NDA has been lifted this week, so no problem to discuss the iOS 4.0 SDK.
As for your question: there's a difference between compiling and running an application.
The NSXMLParserDelegate protocol was added in the iOS4 SDK. In previous versions of the SDK, the XML parser delegate methods were declared in a category. In iOS4, these methods have been moved to a dedicated protocol, which makes it a litte cleaner. At runtime, there's no difference. Once compiled, the app doesn't know anything about protocols or categories. The NSXMLParser will simply check if a specific delegate method is implemented (via respondsToSelctor), so it will run just fine.
In general, it's not a problem to build with iOS4 SDK and run on 3.0. You do have to make sure you don't call any methods that don't exist in 3.0. This is very easy to do by calling respondsToSelector. It allows you to create a single app that runs on all OS versions, but still allows you to call 4.0-specific methods.
I hope this makes sense ...

Developing for 2.2.1 SDK on Snow Leopard

I’ve installed Snow Leopard, have Xcode 3.2 and 3.0 iPhone SDK. I want my applications to run on 2.2.1, but the SDK is nowhere to be found in Xcode. I’ve set the deploy target to 2.2.1, but still I cannot be sure I am not using any 3.0-isms. (I’ve sent a sample application to my friend who still has 2.2.1 and it does not run, so it looks I really do use some 3.0 specific API.) How can make sure that my applications will run on 2.2.1? (Simulator also lists only 3.0 as version option.) I’d hate to check my sources manually for every call that might not have existed in 2.2.1.
See my question.
However, I think this is a bad situation that Apple has created for us. There really is no way to test against 2.x.x, if you, like me, have no iPhone 2.2s to test against. I actually bought a new 3Gs just so I could use the old 3G for testing. Stupidly though, when iTunes came up one day and asked if I wanted my phone updated to 3.0.1, I said yes, without realizing which phone I was updating.
I have tried, to no avail, to downgrade to 2.2.1, doing all the things like holding the home button and power for 10 seconds, etc., but I keep getting a baseband loading error.
I know Apple is trying hard to push everyone to 3.0, but not having the stats on how many users are still on the older OS, it seems prudent to keep supporting that OS. They should at least have kept 2.2.x support for the Simulator. I hate to release a 2.2.1 app based on whether I think I am using 3.0 calls or not, without actually testing it on 2.2.1.
OK, SDK 3.1 was released yesterday (September 9) and also contains SDK 2.2.1. You cannot build for the Simulator, only for the device, but most of the glaring 3.0-isms will appear as compile errors, which makes testing much easier.
Uninstall the SDK or Developer folder completley.
using Terminal execute: /Library/uninstall-devtools --mode=all, then restart, re-install new SDK.