Xcode 5您的二进制文件在validation时未针对iPhone 5进行优化

我正在运行Your binary is not optimized for iPhone 5错误:

错误信息

我尝试了其他问题中提出的每个解决scheme,但没有任何作用 总结:

我在项目的根目录下有Default-568h@2x.png图像,大小为640×1136,其中project_name.xcodeproj是。

遵循一个build议,我添加了Default.png (640×1136)和Default~iphone.png (640×960)到同一个目录。 没有工作。

我正在使用适当大小的资产目录。

这是最奇怪的部分:这是应用程序的1.1版本。 我使用相同的。 xcodeproj具有相同的图像。 它第一次没有问题validation,但现在没有。 有任何想法吗?

使用图像资源全局来控制图像是否正确,并查看是否有警告。

为了将来更好地使用最后的Xcode故事板屏幕:

在这里输入图像说明

以通用模式开启您的应用:

添加故事情节或在自动布局模式下使用StoryBorad。

要使用多个故事板,您可以在application didFinishLaunchingWithOptions中的AppDelegate中使用它:

 #pragma mark - Universal storyboard. if(UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone){ UIStoryboard *storyBoard; CGSize result = [[UIScreen mainScreen] bounds].size; CGFloat scale = [UIScreen mainScreen].scale; result = CGSizeMake(result.width *scale, result.height *scale); if(result.height <= 960){ storyBoard = [UIStoryboard storyboardWithName:@"iPhone4" bundle:nil]; UIViewController *initViewController = [storyBoard instantiateInitialViewController]; [self.window setRootViewController:initViewController]; } } 

您可以添加所有分辨率iPhone 4s / 5(s / c)6和6 Plus

在你的<AppName>-Prefix.pch定义像这样的所有分辨率:

 #define IsIphone5 ( fabs( ( double )[ [ UIScreen mainScreen ] bounds ].size.height - ( double )568 ) < DBL_EPSILON ) #define IsIphone4 ( fabs( ( double )[ [ UIScreen mainScreen ] bounds ].size.height - ( double )480 ) < DBL_EPSILON ) 

然后在您的项目中调用该函数,例如iPhone 4/5和iPad的一个滚动视图:

 - (void)spiegaScroll{ if (IsIphone5){ CGRect scrollFrame; scrollFrame.origin = myScroll.frame.origin; scrollFrame.size = CGSizeMake(320, 568); spiega.frame = scrollFrame; [spiega setContentSize:CGSizeMake(320, 1100)]; myScroll.scrollEnabled = YES; myScroll.pagingEnabled = NO; myScroll.clipsToBounds = NO; } else if (IsIphone4) { CGRect scrollFrame; scrollFrame.origin = myScroll.frame.origin; scrollFrame.size = CGSizeMake(320, 480); spiega.frame = scrollFrame; [spiega setContentSize:CGSizeMake(320, 1100)]; myScroll.scrollEnabled = YES; myScroll.pagingEnabled = NO; myScroll.clipsToBounds = NO; } else { //the rest is iPad in this case CGRect scrollFrame; scrollFrame.origin = myScroll.frame.origin; scrollFrame.size = CGSizeMake(768, 1024); spiega.frame = scrollFrame; [spiega setContentSize:CGSizeMake(768, 2094)]; myScroll.scrollEnabled = YES; myScroll.pagingEnabled = NO; myScroll.clipsToBounds = NO; } } 

希望这可以帮助您现在或将来的应用程序;)

检查图像是否添加到目标文件

在你的plist文件中,在图标集字典中设置图像的值。

有同样的问题。 最后,我发现从iphone 5启动图像问题的解决scheme

请确定568h文件是PNG格式? 另外请确保您为所有屏幕提供了对iphone 5的支持? 仅添加Default-568h@2x.png不支持iphone 5。 你必须检查框架的所有你的看法为iPhone 3.5“和4”设备。

好吧,看起来问题一旦升级到xCode 6就消失了。应用validation没有问题。