Advertise here




Advertise here

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

iPad app rejected due to autorotation problems...

JohanovskiJohanovski Posts: 343Registered Users @ @
edited April 2010 in iPhone SDK Development
Hi there!

I've recently ended my first iPad app (in fact it's an iPhone app adapted to iPad with some changes exploding it's bigger screen) and submitted last friday. Yesterday I've received an Apple's mail saying the app is rejected because it doesn't accomplish with the iPad Human Interface Guidelines due to autorotation issues. The game is designed to be played in portrait mode so I've seen no need to make it playable in landscape, because it's not thought for it. However it seems that Apple doesn't care about that and they want to game to be playable in all possible orientation (both portrait and landscape).
I've tried enabling autorotate in my game (just to see what OpenGL does when I try to rotate the UIView where it's drawn) but I'm not able to enable autorotate.

I've added the following to the "Info.plist" file:
<key>UISupportedInterfaceOrientations</key>
	<array>
		<string>UIInterfaceOrientationPortrait</string>
		<string>UIInterfaceOrientationPortraitUpsideDown</string>
		<string>UIInterfaceOrientationLandscapeLeft</string>
		<string>UIInterfaceOrientationLandscapeRight</string>
	</array>

And then I've added this method in the EAGLView class (which inherits from UIView):
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
	NSLog(@"Autoration!");
	return YES;
}

My project consists in a UIApplication class (the AppDelegate class) which contains the EAGLView class (which inherits from a UIView class), where all game logic and drawn is processed. I think the shouldAutorotate... method must be inside the EAGLView class, right?
Well, the problem is that seems that the method is never called so the log in never printed... Why can this be happening?

Also have to say that I'm working with the simulator (we haven't iPad in Spain yet!) and I don't know if it's a simulator problem (I'm rotating it throw to "Hardware" tab rotation controls, and they work in the Mobile Safari), but I don't think so...

Any help with this?
Thanks in advance! :)
Post edited by Johanovski on

Replies

  • dljefferydljeffery Posts: 1,315iPhone Dev SDK Supporter, Registered Users @ @ @ @
    edited April 2010
    You need to implement that method override in a UIViewController subclass, not a UIView subclass.
    <a href="http://bit.ly/recallit-ipdsdk" target="_blank">Recall It!</a> <i>Tag your notes. Tag your photos. Tag your thoughts. Tag your life.</i><br />
    <a href="http://bit.ly/ipadrecallit-ipdsdk" target="_blank">Recall It! for iPad</a><br />
  • linkmxlinkmx Posts: 247Registered Users
    edited April 2010
    You don't have to support landscape, you just have to support both portrait orientations.

    From iPad HIG:
    Support both variants of an orientation. For example, if your application runs only in landscape, people should be able to use it whether they’re holding the device with the Home button on the right or on the left. And, if people rotate the device 180 degrees while using your application, it’s best if you can respond by rotating your content 180 degrees.
  • JasonRJasonR San Diego, CAPosts: 1,587Registered Users
    edited April 2010
    I'm not sure about the EAGLView, but I had to do was add the following to all my view controllers:
    - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
    	// Return YES for supported orientations.
    	return (interfaceOrientation == UIInterfaceOrientationPortrait || interfaceOrientation == UIInterfaceOrientationPortraitUpsideDown);
    }
    

    All my UI views just worked without any other changes.
    My development blog: <a href="http://jrinn.com" target="_blank">http://jrinn.com</a>;
  • JohanovskiJohanovski Posts: 343Registered Users @ @
    edited April 2010
    Hi there!

    Thanks for your time! I've finally solved this yesterday at the afternoon, after hours trying to understand how to integrate a UIViewController in a project consisting in a UIView... and have to say that I haven't understood it yet, but it works! ^_^ I'm not sure on what I've done and why, but working now so I've already sent it again to Apple, and hope they're going to approve my app this time!

    Thanks! :)
  • TwanBTwanB Posts: 28Registered Users
    edited April 2010
    JasonR wrote: »
    I'm not sure about the EAGLView, but I had to do was add the following to all my view controllers:
    - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
    	// Return YES for supported orientations.
    	return (interfaceOrientation == UIInterfaceOrientationPortrait || interfaceOrientation == UIInterfaceOrientationPortraitUpsideDown);
    }
    

    All my UI views just worked without any other changes.

    So, I should put the code above in the *.m-files?
    How can I check if this works? Will the iPad Simulator (3.2) support this?
    Will the iPhone device support this as well?
  • JohanovskiJohanovski Posts: 343Registered Users @ @
    edited April 2010
    Hi Twain!

    This method is only implemented by the UIViewController, so if you have one you should put this in it (in the .m file of your UIViewController class). If you haven't got one and you are using a UIView (like me) you should integrate a UIViewController to the UIView (don't ask me how to do, I've done but I'm not even sure how, a lot of testing, breaking things, and then magically worked but I don't know what I've exactly done...).
    For the iPad your application MUST work at least by both orientations of your application preferred format (so if you're using landscape your app must work in both landscape directions). It's recommended to support all four orientations, but it's not needed (if your game is designed to work in landscape there's no sense to let it be played in portrait mode).
    And yes, it works in the simulator (so you can test there) and once it's implemented it should work in the iPhone as well.

    Hope it helped! :)
Sign In or Register to comment.