1

As many of you already know Apple released a new OS last week so I installed it on my system to see if the project I'm working on works. Well, absolutely nothing works.

There are a lot of deprecated methods so I would like some advice on how to tackle updating your code so it is compatible with the new platform.

gnat
  • 21,442
  • 29
  • 112
  • 288
Samantha Catania
  • 345
  • 1
  • 3
  • 11

1 Answers1

5

A deprecated method doesn't normally just stop working; Apple are just indicating that the method is no longer the preferred way of doing things and that it might go away in a future release. Often the documentation will describe the replacement, which might be a different method (as was the case when the -[NSString cString]-style methods were deprecated in favour of methods that explicitly request a particular character encoding), or is sometimes a completely different approach (as with AuthorizationExecuteWithPrivileges(), which you should replace with Not Doing It Like That™).

Other sources of information on migrating away from deprecated API include the WWDC videos and Apple's programming guides, which offer a more high-level description of the frameworks so explain how Apple currently think they should be used. Then you could ask on stack overflow or Apple's developer forums. Finally, there's the option of buying a developer tech support incident from them and getting their engineers to suggest an alternative.

Each part of your code that touches deprecated API will need updating sooner or later, because the writing's on the wall for the deprecated methods. This is a great time to take a look at those classes affected, and ask yourself whether you just need to update how they interact with the system or whether the whole class could be approached in a better way. If you need to make changes, you may as well make the product better while you're in there.