宏指令
#ifdef
__IPHONE_5_0 //5.0 or higher
- (void) newMethod;
#else
- (void)oldMethod;
#endif
判断代码
float version = [[[UIDevice currentDevice] systemVersion] floatValue];
if(version >= 3.0){
执行代码
}
#ifdef
__IPHONE_5_0 //5.0 or higher
- (void) newMethod;
#else
- (void)oldMethod;
#endif
float version = [[[UIDevice currentDevice] systemVersion] floatValue];
if(version >= 3.0){
执行代码
}