Posted by: bearc0025 | June 3, 2009

iPhone 3.0 with backward compatibility–step by step

Developer Forums Beta: 3.0 with backward compatibility–step by step (UPDATE: I think this link is dead.)

These steps in the post above will help you run a 3.0 compiled app on a 2.x device.


UPDATE: Given that the link above is dead (apparently) here’s some other/more info:

Apple has some Sample code that does it.

Basically you weak link the framework (e.g., StoreKit).

Then you instantiate the classes by name (e.g., Class mailClass = (NSClassFromString(@”MFMailComposeViewController”));).

Then if the the object isn’t nil, you can call methods on it. Or call them performSelector.

To make the framework a weak-link, go to your ->Get Info and click on the General tab. The frameworks will specify the Required/Weak:

Weak-Link Framework

There are plenty of posts about conditional compiles and run-time checks:

Cross-Platform Development

respondsToSelect checks

OS Version checkhink

Advertisements

Responses

  1. Thanks for the info about weak linking- I had no idea!


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Categories

%d bloggers like this: