views:

123

answers:

1

I have a program that ran in iOS 2.0 and now am making some updates to it. I don't think I have done anything that won't be available in 3.0, but I don't have a 3.0 device around to test it on. I do know that I updated one deprecated function addTimeInterval to the new version dateByAddingTimeInterval

a few questions -

1) Is there any way to get XCode to highlight any code that was deprecated in a prior OS version?

2) If I set the target to 3.0, and it compiles file, does that necessarily mean that I didn't call anything that 3.0 can't run?

3) I have an old 3GS that I had upgraded to 4.0. Is there any way I can get a 3.0 or 3.1 restore file so I can just downgrade that iPhone and use it as a testbed?

Thanks

A: 

1) Is there any way to get XCode to highlight any code that was deprecated in a prior OS version?

Xcode does so automatically due to the existence of C macros that signal deprecation, i.e.:

UIKIT_EXTERN NSString *const UIKeyboardBoundsUserInfoKey        __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_NA,__MAC_NA,__IPHONE_2_0,__IPHONE_3_2);

2) If I set the target to 3.0, and it compiles file, does that necessarily mean that I didn't call anything that 3.0 can't run?

No, because it's not the Deployment Target that matters here, it's the Base SDK setting that matters. For example, if you set your Base SDK to 4.1 and Deployment Target to 3.1.3, and then compile the following code:

if (UI_USER_INTERFACE_IDIOM == UIUserInterfaceIdiomPad)

It will compile fine, but it will result in a run-time error on a 3.1.3 device (actually, any device running <3.2)

3) I have an old 3GS that I had upgraded to 4.0. Is there any way I can get a 3.0 or 3.1 restore file so I can just downgrade that iPhone and use it as a testbed?

It is not possible to roll the firmware back on iPhones (although I've read that it is possible to rollback firmware on iPod Touches, but I haven't tried).

Shaggy Frog
This seems to be a deficiency in the development system. Or perhaps its an Apple intended 'feature' that encourages developers to leave the non-upgraders behind
fogelbaby
If you are talking about being unable to rollback firmware versions, I think you're partially correct. I think it's probably a combination of factors: it's a giant PITA to support old firmware; old firmware may have old carrier settings which should never be re-enabled; it eliminates a potential source of user problems; etc.
Shaggy Frog