iOS 6背景图像
答
从我挂在注释后
#import <sys/utsname.h>
NSString*
machineName()
{
struct utsname systemInfo;
uname(&systemInfo);
return [NSString stringWithCString:systemInfo.machine
encoding:NSUTF8StringEncoding];
}
结果应该是:
@"i386" on the simulator
@"iPod1,1" on iPod Touch
@"iPod2,1" on iPod Touch Second Generation
@"iPod3,1" on iPod Touch Third Generation
@"iPod4,1" on iPod Touch Fourth Generation
@"iPhone1,1" on iPhone
@"iPhone1,2" on iPhone 3G
@"iPhone2,1" on iPhone 3GS
@"iPad1,1" on iPad
@"iPad2,1" on iPad 2
@"iPhone3,1" on iPhone 4
@"iPhone4,1" on iPhone 4S
我假定这将返回类似@“iPhone5,1”最新模型。然后,只需做这样
NSString *iphoneType = machineName();
if ([iphoneType [email protected]"iPhone5,1"]){
//image for iphone 5
} else {
//image for the rest
}
支票让我知道,如果可以算出
计划的方式是明确的。可能它有什么“通过Apple批准”? 喜欢用@xxx名字等图像 –
你是说整个背景是一个图像? – TheJer
假定它是:) –