3
votes

I'd like to support orientations portrait and portrait upside-down on Sample code "GLPaint". What's code this app support orientations portrait and portrait upside-down?

Sample code "GLPaint" http://developer.apple.com/library/ios/#samplecode/GLPaint/Introduction/Intro.html%23//apple_ref/doc/uid/DTS40007328

this sample use Object window not subclass UIViewController. I tried this code, but didn't work.

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
if ((interfaceOrientation == UIInterfaceOrientationPortrait) ||
(interfaceOrientation == UIInterfaceOrientationPortraitUpsideDown))
return YES;
return NO;
}

i tried to modify the app to set up a view controller 2 patterns.

A:GLPaint add subclass View Controller. B:New Project OpenGL ES Application add GLPaint.

Both were bad. Currently, i don't know what wrong with the source code.

1

1 Answers

1
votes

Put PaintingView into built view controller, it works well on my side. View Controller can control interface direction.