//获取版本号
NSString *versionNum = [[[NSBundle mainBundle] infoDictionary]
objectForKey:(NSString *)kCFBundleVersionKey];
//判断是否为iphone设备
[[UIDevicecurrentDevice]userInterfaceIdiom] ==UIUserInterfaceIdiomPhone
//判断真机或者模拟器宏定义
#if TARGET_IPHONE_SIMULATOR
//模拟器
#elif TARGET_OS_IPHONE
//真机
#endif
如果要收回键盘,可使用
[self.viewendEditing:YES];
快速的定义一个weakSelf
#define WS(weakSelf) __weak __typeof(&*self)weakSelf = self;