0

I'm new to Objective C and Xcode. I'm building an iPad app, the best that I can.

But I'm currently stuck.

I have a tabbed app, with 3 buttons at the bottom. They all work. I want to add a new button. But every time I use Interface Builder to add a button to my tab bar, or even move the buttons around the tab bar, I then go into the Simulator and it turns out that I've lost my ability to change orientation. The view is stuck in portrait. If I delete the new button, or undo the move, then I regain my powers of orientation.

What could be causing this?

1 Answers1

0

You need to specify the new ViewController is able to rotate, if one can't then the whole app won't with a TabBar.

- (BOOL)shouldAutorotateToInterfaceOrientation: (UIInterfaceOrientation)interfaceOrientation
{
// Return YES for supported orientations
return YES;
}
Mitchell Currie
  • 2,769
  • 3
  • 20
  • 26
  • First off, thank you so much for the advice. On several sites and involving several different questions you're the first person to actually respond to one of my questions. You know, I think the UIViewController subclass template I'm using defaults with the that code already in there. I went into the ".m" file, that my xib is connected to, and it was already there. Any chance I may be looking at the wrong spot? – barowdwngs Oct 31 '11 at 06:04
  • It might be something else then, search globally in the project for shouldautorotate, and make sure they all return yes. Also make sure the right class for the view controller is instantiated, put a break point on the shouldautorotate, it should get called and stop. – Mitchell Currie Oct 31 '11 at 06:14
  • Bummer. That would have made perfect sense. I didn't see any missing though. What's really strange is that I can still lose the rotation just by moving the tabs around. It doesn't even require me to to add a new page. I'm learning off of this template I found online. It has a split view embedded in a tab navigation. Maybe it's some sort of wacky code the creator has used to merge the two forms of navigation... Or maybe he just didn't want anyone to add buttons to his masterpiece. – barowdwngs Oct 31 '11 at 06:34
  • Perhaps you are changing the order of the default screen? – Mitchell Currie Nov 01 '11 at 23:30