Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4607328
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T00:41:15+00:00 2026-05-22T00:41:15+00:00

Noobie so bear with me. I’ve have been following the O’Rielyy Learning iPhone Programming

  • 0

Noobie so bear with me.

I’ve have been following the O’Rielyy Learning iPhone Programming and various threads on here to build my first iPhone App. So far so good, but the final stumbling block at the projects end is getting the App to autorotate (the beta using only uiwebviews was rejected for not auto-rotating)

I have the mail App delegate, which adds a UITabBarController

// myNewsUKDelegate.h
@interface myNewsUKDelegate : NSObject <UIApplicationDelegate, UITabBarControllerDelegate> {
    UIWindow *window;
    UITabBarController *tabBarController;
}
@property (nonatomic, retain) IBOutlet UIWindow *window;
@property (nonatomic, retain) IBOutlet UITabBarController *tabBarController;
@end

// myNewsUKDelegate.m
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    // Add the tab bar controller's view to the window and display.
    [self.window addSubview:tabBarController.view];
    [self.window makeKeyAndVisible];
    return YES;
}

There is are .h and .m files for tabBarController – I added all the UINavigationControllers in IB, which in turn add a UITableView

See image at http://flatearth.co.uk/nib.png (too noob to post images in questions!)

From my reading I understand that the issue is the UITabBarController I added to the main view needs to be ‘subclassed’ and have this code added.

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
    return YES;
}

The next view down/in/subclassed (whatever the correct terminology is), which has .h and .m files is the FirstViewController which adds the table view, this has shouldAutorotateToInterfaceOrientation already set.

@interface FirstViewController : UIViewController <UITableViewDataSource, UITableViewDelegate> {
    UITableView *tableView;
    NSArray *userList;
}
@property (nonatomic, retain) IBOutlet UITableView *tableView;
@property (nonatomic, retain) NSArray *userList;
@end

@implementation FirstViewController

@synthesize tableView;

- (void)viewDidLoad {
    [super viewDidLoad];
    // I tried adding
    self.view.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
    // lots of other code ; )
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
    return YES;
}

So the problem appears to be that when [self.window addSubview:tabBarController.view]; adds the tab bar it doesn’t add the shouldAutorotateToInterfaceOrientation returning YES bit.

It appears that I need to add a tabBarController subclass, with the shouldAutorotateToInterfaceOrientation in it. So I read up and tried this, as suggested on the interwebs…

//  tabBarController.h
#import <UIKit/UIKit.h>
@interface tabBarController : UITabBarController {

}
@end

//  tabBarController.m
#import "tabBarController.h"
@implementation tabBarController
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
    return YES;
}
@end

and adding

#import "tabBarController.h"

to myNewsUKDelegate.m

But that fails with “error: accessing unknown ‘view’ class method” at the

[self.window addSubview:tabBarController.view];

line in myNewsUKDelegate.m

Further searching hasn’t produced anything helpful and my recent Xcode knowledge has now ran dry : ( Any help appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T00:41:16+00:00Added an answer on May 22, 2026 at 12:41 am

    From my reading I understand that the issue is the UITabBarController I added to the main view needs to be ‘subclassed’ and have this code added.

    No, you don’t need to do that. The tab bar controller determines if it supports a specific interface orientation or not by asking all its child controllers if they support this orientation. In your case, these seem to be navigation controllers, which in turn ask their current child controller if it supports the orientation.

    In other words, you have to make sure that all your custom view controllers return YES for the desired interface orientation.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So, the noobie question of the day... I have an XML file with the
Okay. This is propably very basic and noobie, but I have about 20+ stores
I am writing my first ever bash script, so excuse the noobie-ness. It's called
This may be a very noobie question, but in today's world of web app
Hi all a bit of a noobie jquery problem with codaslider I'm afriad. I
Sorry if this sounds like a bit of a noobie question, i'm still relatively
I have a list like ['hello', '...', 'h3.a', 'ds4,'] this should turn into ['hello',
where do I begin? I can't seem to find any definitive documentation. (I am

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.