xcode - Only run code if iOS < 6.0 with preprocessing? -
I can find many examples of how the compile / run code is the IOS version & gt; Something, but how can I do this in another way? I made the following attempts by running iOS 5.0 in the simulator:
#if __IPHONE_OS_VERSION_MAX_ALLOWED & lt; __IPHONE_6_0 // Code for iOS & lt; 6.0 is not running on iOS 5.0 in code simulator inside #endif but under #if - #endif How can I do this? [edit] Ok then I was not sure what I wanted, sorry :) This is the thing that I want this code in my UITableViewDelegate only when the device is running iOS & Lt; 6.0:
- (UIView *) Table view: (UITableView *) table view view FORHeaderInSection: (NSInteger) section {} This is because I Want to do some style if I'm running iOS & lt; 6, but I can make this style very easy on iOS 6. But in this method there is not really a check on a runtime on the runtime which is what I want because then it is late.
Thank you / Suren
After the
- There is a difference between compiling time checks you are compiling against a specific SDK and
- checking which OS is checking for your code __IPHONE_6_0 macro will only check which target for you. .. are compiling>
Running what is what you want? If so, you can use #ifndef __IPHONE_6_0 to check if you do not compile for iOS 6 You want to know If your code OS is running, you can check MSK.
Comments
Post a Comment