1

if i have developed an app in older ios version and in future if lot of classes and methods are deprecated...how do i overcome this to make my app run in all version...

The basic solution is checking whether the class exists??that is making use of weakly linked class concept...like:

if (NSClassFromString(@"NewClass")){
    NewClass *try=[NewClass new];
    [try print1new];
    }else{
        OldClass *try1=[OldClass new];
        [try1 print1];
    }

but since i have used deprecated methods in lot of places....i cant modify each and every thing...is there any solution to overcome deprecation with minimal changes in the old code.

user2017
  • 73
  • 7

1 Answers1

4

You can't really. Deprecation is something that will happen as the OS-versions progress. I'd suggest you ensure that it runs on the latest 2, maybe 3 versions so e.g. iOS10, iOS9 & iOS8.

There will also be very little people with devices that still run on iOS7 or older. And even if, the AppStore has e neat feature which allows them to download the latest compatible version of your application (if there has ever been one).

This allows you to focus on the current version and it prevents your code from bloating due to 15 version-checks in every method, which, in return, reduces the chance of errors.

TMob
  • 1,278
  • 1
  • 13
  • 33