//獲取版本號
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;