What should I do to adapt my app to iOS 5.0 keeping compatibility with iOS 4

后端 未结 4 722
盖世英雄少女心
盖世英雄少女心 2021-02-10 05:05

I\'ve started playing with iOS 5 today and I\'ve seen that XCode 4.2 only let me select iOS 5 as Base SDK but not iOS 4.

Until now I\'ve overwriting drawRect: method in

4条回答
  •  渐次进展
    2021-02-10 05:49

    You can't do this with macros since both code paths have to be in place and the correct route to go depends on a run-time check.

    Soooo... use something like this:

    NSString *os_version = [[UIDevice currentDevice] systemVersion]; 
    

    to get the iOS version you're currently running on and do the [UINavigationBar appearance] under 5 & newer, and you can fall back to the drawRect thing on iOS 4.

提交回复
热议问题