宏:
#define kVersion [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleShortVersionString"]
比较:
NSString* lastVersion = @"1.2.3";
if([kVersion compare:lastVersion] != NSOrderedDescending){
return YES ;
}
return NO ;
现在比较的这一行总是有警告:Incompatible pointer types sending "NSString *" to parameter of type "NSNumber *"
从这个警告看,kVersion的类型是NSNumber *