if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 4.0) { }
判断版本号
原文:http://www.cnblogs.com/huoran1120/p/5533296.html