【发布时间】:2011-12-07 16:21:05
【问题描述】:
我需要在我的 iPhone 应用程序中区分视网膜屏幕或普通屏幕,类似于:
#if TARGET_OS_IPHONE_VERSION < 3
NSString *uniquePath = [[NSHomeDirectory() stringByAppendingPathComponent:@"Documents"] stringByAppendingPathComponent:@"close.png"];
UIImage *image = [UIImage imageWithContentsOfFile: uniquePath];
#endif
#if TARGET_OS_IPHONE_VERSION >= 4
NSString *uniquePath = [[NSHomeDirectory() stringByAppendingPathComponent:@"Documents"] stringByAppendingPathComponent:@"close@2X.png"];
UIImage *image = [UIImage imageWithContentsOfFile: uniquePath];
#endif
有什么想法吗?
【问题讨论】:
标签: objective-c ios4 version preprocessor-directive