1.单任务判断 utsname
- (BOOL)isSingleTask{
struct utsname name;
uname(&name);
float version = [[UIDevice currentDevice].systemVersion floatValue];//判定系统版本。
if (version < 4.0 || strstr(name.machine, "iPod1,1") != 0 || strstr(name.machine, "iPod2,1") != 0) {
return YES;
}
else {
return NO;
}
}
2.判断是否为iPad
#define IS_IPAD ([[UIDevice currentDevice] respondsToSelector:@selector(userInterfaceIdiom)] && [[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad)
3.有些信息比如分享和支付宝这样的ID,可以放到Info.plist中。