ysnky
ysnky

Reputation: 281

finding unsupported apis with os version

I've developed and application for iPhone. It works fine on os4 but it does not work on os3.1. In fact works but there are some problems; after splash screen a what screen appears. while I leaving the application I can see the application is opened successfully but just see while exiting.

So I wonder if there is a tool which says which apis have problems with os3.1? So I have a chance to replace them.

Upvotes: 4

Views: 1412

Answers (3)

user189804
user189804

Reputation:

It's a good idea to get a second installation of Xcode for this situation, in this case you need 3.2.1 with SDK 3.1.3 - I wish I could help you with a download link since it is no longer shown on Apple's page, but I have googled in the past and found direct, official download links which will work as long as you are signed in with your developer account, so good luck.

The annoying bit is that you need to go through your project files and set "Base SDK" to 3.1.3 and then back once you have completed the exercise. But it is the easiest way to flag what you can't do in 3.1.3. "sudo rm -rf" (I feel nervous even typing that) has an excellent method there but you need to have an inkling of what might be safe and what might not before you implement it or else you end up with code 10x the size it needs to be.

Apple really needs to sort out this issue - hopefully by flagging methods that are prior to your specified "Deployment Target", in the same way that deprecated methods are flagged.

Upvotes: 0

Jeremy W. Sherman
Jeremy W. Sherman

Reputation: 36143

Set your project's Base SDK to iphone-os-3-1, then build. All the error messages about classes, methods, and functions that don't exist must designate things added since iphone-os-3-1, since your project built and linked fine against the iphone-os-4-0 SDK.

If you don't have the iphone-os-3-1 SDK, try this instead:

  • Open your project's Build Settings.
  • Find the "Preprocessor Macros" setting.
  • Edit it and add __IPHONE_OS_VERSION_MAX_ALLOWED=30100

Now, try building. This should cause everything introduced after iOS 3.1 to be labeled unavailable, producing the same errors as if you had switched to the iphone-os-3-1 SDK.

Upvotes: 1

sudo rm -rf
sudo rm -rf

Reputation: 29524

If you want to check a specific API, just run this in your code somewhere with an appropriate response. For example, to see if print is supported, run this...

if (NSClassFromString(@"UIPrintInfo")) {

}

Upvotes: 1

Related Questions