在iPhone上制作一个iPhone特定的应用程序,以满足苹果的要求

我的应用程序已经在AppStore几个月,现在只能在iPhone上运行。 我最近提交了一个更新,因为应用程序没有在iPad上运行,所以被拒绝了。 被拒绝的确切原因是:

拒绝原因:2.10:iPhone应用程序还必须在iPad上运行而不用修改,iPhone分辨率和2X iPhone 3GS分辨率

我需要在Xcode中做些什么来使我的应用程序在带有2X图标的小盒子的iPad上运行?

任何提示说明将大规模赞赏…

编辑这是我的info.plist。 这是我的第一个应用程序,我想我最初select设置“通用”select。 现在有没有简单的方法来纠正这个问题?

PLIST内容...

首先确定你的应用程序为什么不能在iPad上工作。 大多数为iPhone开发的应用程序在iPad上都能正常工作(在兼容模式下),无需修改; 如果你的没有,你必须做一些事情来阻止它。 你依靠一些硬件function吗? 对你正在运行的设备做出毫无根据的假设? 在iPad上运行时,您的应用程序如何失败?

一旦你知道为什么它不起作用,你会比现在更接近解决问题。

要让您的应用程序在iPhone兼容模式下在iPad上运行,您只需构buildiPhone应用程序。

从应用程序的plist(nib base,xib和storyboard)以及目标构build设置目标设备系列中删除所有iPad引用。

我有同样的问题,我做了以下更改后,能够在iPad上运行我的应用程序。

  1. 在项目设置中使设备到iPhone(这是通用的之前)
  2. 在.plist中删除了与iPad相关的主要故事板文件基本名称。

我已经使用这种情况解决了相同的问题。

你应该检查资源文件夹中的正常和视网膜图像。

debugging时也可能出现此错误Could not load the "image.png" image referenced from a nib in the bundle with identifier

一个普通的iPhone应用程序必须在(1x和2x)模式下在iPad上运行而无需修改。 您可以使用SDK模拟器进行检查。

苹果iOS开发者门户中心的App Store评论指南中有一长串列表,其中列出了许多苹果在提交应用程序时对此进行评论的内容。 仔细阅读。

我会尽力解释我的问题和解决scheme

我有一个iPhone只是应用程序,这是大多是肖像,但是,由于1或2 UIViewControllers必须在所有UIInterfaceOrientations ,我必须启用我的plist所有UIInterfaceOrientations

当在横向旋转的iPad上启动应用程序并且躺在桌子上时( UIDeviceOrientationFaceUp如此),整个应用程序被显示在横向上,这使得我的UI完全混乱了。

我没有参考我的plist或启动屏幕上的任何与iPad相关的代码/设置(我正在使用启动屏幕的.xcassets)。

我通过将1行代码添加到我的AppDelegate.m中来修复它,它将状态栏方向设置为在纵向模式下强制应用程序。

 -(BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { [[UIApplication sharedApplication] setStatusBarOrientation:UIInterfaceOrientationPortrait animated:NO]; //Further setup } 

我有使用Cocos2d 2.0相同的问题

我的问题是,这个项目已经发展了好几年,并且还带着一些现在已经退化的文件,比如RootViewController,UIViewController和MyRootViewController等等。

他们在当时工作,但显然已经与今天的审查委员会举起了一面旗帜,因为我收到了“所有iPhone应用程序必须在iPad上工作”的拒绝通知。 在大声尖叫并最终接受失败之后,我认为这个政策使得仅仅制作应用程序iPhone变得相当困难。 让我知道如果我错了这个。

尽pipe我当时(现在还在)对此感到不安,但我现在至less可以用一个更加优雅的解决scheme来清理项目,这个解决scheme可以解决基础问题:设备旋转+内容旋转。 我最终使用了一个更近期的项目,这个项目看起来更加优雅,而且实际上工作起来很简单:只需将MyNavigationController添加到我的AppDelegate的顶部即可。

我已经添加了下面的代码。 我相信它可以改进。 请评论,如果你可以加强它。

因此,我能够删除旧的RootViewController和MyRootViewController文件,所以现在更容易维护。 无论如何,我从来都不明白他们的目的。 甩掉包袱!

这是我的解决scheme来显示和匹配设备方向+内容方向:

在AppDelegate.h中,我不得不声明我在做什么:

//文件的顶部

@interface MyNavigationController:UINavigationController @end

//在AppDelegate.h接口里面

MyNavigationController * navController_;

// @end之前的文件底部

@属性(只读)MyNavigationController * navController;

这是在我的AppDelegate.m的顶部工作的代码

@implementation MyNavigationController

 // The available orientations should be defined in the Info.plist file. // And in iOS 6+ only, you can override it in the Root View controller in the "supportedInterfaceOrientations" method. // Only valid for iOS 6+. NOT VALID for iOS 4 / 5. -(NSUInteger)supportedInterfaceOrientations { UIDeviceOrientation orientation = [[UIDevice currentDevice] orientation]; if (orientation == UIDeviceOrientationPortrait) { if(UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) { // [director_ pushScene: [IPAD scene]]; } else { [[CCDirectorIOS sharedDirector] pushScene:[VerticalDisplayLayer scene]]; return UIInterfaceOrientationMaskPortrait; } } else if (orientation == UIDeviceOrientationLandscapeLeft) { if(UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) { // [director_ pushScene: [IPAD scene]]; } else { [[CCDirectorIOS sharedDirector] pushScene:[MainMenuScene scene]]; } } else if (orientation == UIDeviceOrientationLandscapeRight) { if(UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) { // [director_ pushScene: [IPAD scene]]; } else { [[CCDirectorIOS sharedDirector] pushScene:[MainMenuScene scene]]; } } else if (orientation == UIDeviceOrientationPortraitUpsideDown) { if(UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) { } else { [[CCDirectorIOS sharedDirector] pushScene:[VerticalDisplayLayer scene]]; return UIInterfaceOrientationMaskPortraitUpsideDown; } } else { //do nothing } return UIInterfaceOrientationMaskLandscape; 

}

 //this is the one for iOS 6 - (BOOL)shouldAutorotate { //NSLog(@"MyNavigationController - should Rotate ToInterfaceOrientation ..."); UIDeviceOrientation orientation = [[UIDevice currentDevice] orientation]; // iPhone only if( [[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone ) { //NSLog(@"MyNavigationController - should Rotate iPhone"); if (orientation == UIDeviceOrientationPortrait) { //NSLog(@"should Rotate iPhone orientation is Portrait"); [[CCDirectorIOS sharedDirector] pushScene:[VerticalDisplayLayer scene]]; return UIInterfaceOrientationMaskPortrait; } if (orientation == UIDeviceOrientationPortraitUpsideDown) { //NSLog(@"should Rotate iPhone orientation is PortraitUpsideDown"); [[CCDirectorIOS sharedDirector] pushScene:[VerticalDisplayLayer scene]]; return UIInterfaceOrientationMaskPortraitUpsideDown; } if (orientation == UIDeviceOrientationLandscapeLeft) { //NSLog(@"should Rotate iPhone orientation is Landscape Left"); return UIInterfaceOrientationMaskLandscape; } if (orientation == UIDeviceOrientationLandscapeRight) { //NSLog(@"should Rotate iPhone orientation is Landscape Right"); return UIInterfaceOrientationMaskLandscape; } return TRUE; } //return UIInterfaceOrientationIsLandscape(interfaceOrientation); if( [[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad ) { //NSLog(@"MyNavigationController - should Rotate iPad"); return TRUE; } return TRUE; } // Supported orientations. Customize it for your own needs // Only valid on iOS 4 / 5. NOT VALID for iOS 6. - (BOOL)shouldAutorotateToInterfaceOrientation: (UIInterfaceOrientation)interfaceOrientation { // iPhone only if( [[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone ) return TRUE; //return UIInterfaceOrientationIsLandscape(interfaceOrientation); if( [[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad ) return TRUE; // iPad only // iPhone only //return UIInterfaceOrientationIsLandscape(interfaceOrientation); return TRUE; } // This is needed for iOS4 and iOS5 in order to ensure // that the 1st scene has the correct dimensions // This is not needed on iOS6 and could be added to the application:didFinish... -(void) directorDidReshapeProjection:(CCDirector*)director { if(director.runningScene == nil) { // Add the first scene to the stack. The director will draw it immediately into the framebuffer. (Animation is started automatically when the view is displayed.) // and add the scene to the stack. The director will run it when it automatically when the view is displayed. [director runWithScene: [MainMenuScene scene]]; } } -(void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration { // Assuming that the main window has the size of the screen // BUG: This won't work if the EAGLView is not fullscreen CGRect screenRect = [[UIScreen mainScreen] bounds]; CGRect rect = CGRectZero; //NSLog(@"MyNavigationController - Will RotateToInterfaceOrientation ..."); if(toInterfaceOrientation == UIInterfaceOrientationPortrait || toInterfaceOrientation == UIInterfaceOrientationPortraitUpsideDown) { rect = screenRect; } else if(toInterfaceOrientation == UIInterfaceOrientationLandscapeLeft || toInterfaceOrientation == UIInterfaceOrientationLandscapeRight) { rect.size = CGSizeMake( screenRect.size.height, screenRect.size.width ); } CCDirector *director = [CCDirector sharedDirector]; CCGLView *glView = (CCGLView *)[director view]; glView.frame = rect; } @end 

这就是为什么我必须解决这个问题:

  1. 我需要风景和肖像模式来显示不同的场景。

以下是一些描述情况的截图

JR化学组

大部分的应用程序定位是像这张照片所示的风景

其他区域只有在您打开设备时才会触发

2个应用程序在一个!