Uderc programming article aggregator sites

Gettin my app to autorotate

Answers: Have 14 answers
My app got rejected for not autorotating so I am trying to implement that now.
My app is a painting application based off GLPaint. The problem with this is that there is no ViewController class and that is where this code is found that does the autorotation:
-(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceO rientation {
// Return YES for supported orientations
return YES;
So since I dont have this class only a AppController and PaintingView, where do I implement this code. Is it possible to create a view controller and have it link up to control my MainWindow.xib?
If not, then how can I make my app autorotate. Thank you.
The best answer: OK. I am assuming that you are using the OpenGLES Template iPad application to start your project. Why Apple choose to make it look like it does is beyond me, but there you go.
What you need to do is start a View based application, and then copy in the opengl parts of the opengles template project into the view based project. Then in the ViewDidLoad function, you need to create an instance of your OpenGLES View (EAGLView or something like that). You then have an autorotating OpenGLES project. Yay.
There are other issues with doing this, but with a simple project it should be fine. If, like me, you want to run the OpenGL updates in a thread, it then becomes a world of pain, with everything being initialised at the wrong times and crashing in openGL functions etc.... but for what you are doing, this will work perfectly !
Haven't got the code to hand at the moment, but if you look on the web, there should be examples like this.


Related articles

Autorotate bug with 5800 - hope Nokia reads this.

I keep gettin updates from my app store but yet when I go in and update all it starts the update and then pops up and tells me that the application cannot be downloaded at this time. I have had to delete a few apps bc this isn't working.

The autorotation function has stopped working in my text message app. only.  It is working for all other applications.  What has happened? How can I fix it.  The autorotate is on.


PhotoLocations, or CoreData bug? Image autorotates when app saves

I am trying to set up my billing information on my iphone and I keep gettin this for assistance contact itunes support and I just want to download apps and buy songs I need help!

I can't download free apps without a credit card how do I get around this I don't have credit or debit account?

For the average person what really is the point of the activity monitor app when all you really want to know is whether your mac is running at its best?

Autorotate stops when switching view from popover

Updating apps, keeps asking for billing info

Recommended article

HELP - I just downloaded the update, and now all my keynote slide shows have ugly symbols (sort of a black box with an O in the middle) wherever I clicked 'return' to go down a bullet or to edit text.  It does not let me delete these marks

Sharepoint excel web services

How Do I Make a Toggle Button

XI/PI: jdbc receiver using stored procedure with arrays

Issue with Java script associated with WAD template

Security Flaw Discoverer 10g

What is the meaning of different fields of Oracle Software e.g

Running JDK1.4.1 on SPARC 20 (SunOS 5.7) reports "Needs SunOS 5.6 or later"

All pages contents are diagonal (text, pictures, buttons...)

CreatePDF to convert Framemaker binary (.fm) files to PDF