Cleaner XCode macro for this

Currently I am using something like this for ARC compatibility between iOS 4.0~4.3:

- (void) viewDidUnload {
#if __IPHONE_OS_VERSION_MIN_REQUIRED > __IPHONE_4_3
#else
    //set outlets to nil
#endif
}

The #if<->#else area is always empty. So my question is this. Is there a cleaner way to write the #if line so I don't need the #else statement? I tried to use "<" but it didn't seem to understand.

Answers


So I can now answer my own question. Brace yourselves:

Take

#if __IPHONE_OS_VERSION_MIN_REQUIRED > __IPHONE_4_3
#else
    //set outlets to nil
#endif

and replace it with

#if __IPHONE_4_3 > __IPHONE_OS_VERSION_MIN_REQUIRED 
    //set outlets to nil
#endif

It seems the compiler doesn't support < in macros.


Need Your Help

Random Invalid Viewstate Error

c# asp.net webforms .net-4.5

I know there are a lot of questions on this topic and I have read them all.

Custom UITableViewCell drawn with CoreGraphics and threading issues

ios uitableview thread-safety core-graphics

I'm using core graphics to draw a custom UITableViewCell, based on the Fast TableView sample from Loren Brichter.