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

  • Home
  • SEARCH
  • 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 7054469
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T03:37:49+00:00 2026-05-28T03:37:49+00:00

I subclassed UIViewController as STViewController and noticed that classes inheriting from STViewController have their

  • 0

I subclassed UIViewController as STViewController and noticed that classes inheriting from STViewController have their viewDidLoad method being called repeatedly. Ultimately crashing the app. STViewController is basically a blank implementation at this point. I am subclassing as shown below:

#import "STViewController.h"

@interface WelcomeViewController : STViewController {

STViewController.h

#import <UIKit/UIKit.h>

@interface STViewController : UIViewController
{
}
@end

STViewController.m

#import "STViewController.h"


@implementation STViewController

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (void)loadView
{
    // Implement loadView to create a view hierarchy programmatically, without using a nib.
}

- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
}

- (void)viewDidUnload
{
    [super viewDidUnload];
    // Release any retained subviews of the main view.
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    return (interfaceOrientation == UIInterfaceOrientationPortrait);
}
@end

viewDidLoad() from WelcomeViewController.m

- (void)viewDidLoad
{
    [super viewDidLoad];

    // hide the buttons
    [[self signUp] setHidden: YES];
    [[self logIn] setHidden: YES];
}
  • 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-28T03:37:49+00:00Added an answer on May 28, 2026 at 3:37 am

    You are overriding loadView, but your implementation is empty, and you’re not assigning a view. Remove the loadView override.

    From UIViewController Class Reference (emphasis mine):

    You should never call this method directly. The view controller calls
    this method when the view property is requested but is currently nil.
    If you create your views manually, you must override this method and
    use it to create your views. If you use Interface Builder to create
    your views and initialize the view controller—that is, you initialize
    the view using the initWithNibName:bundle: method, set the nibName and
    nibBundle properties directly, or create both your views and view
    controller in Interface Builder—then you must not override this
    method.

    The default implementation of this method looks for valid nib
    information and uses that information to load the associated nib file.
    If no nib information is specified, the default implementation creates
    a plain UIView object and makes it the main view
    .

    If you override this method in order to create your views manually,
    you should do so and assign the root view of your hierarchy to the
    view property
    . (The views you create should be unique instances and
    should not be shared with any other view controller object.) Your
    custom implementation of this method should not call super.

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

Sidebar

Related Questions

so I have subclassed a UIViewController that I create. The question is, is there
I have a main UIViewcontroller (vcMain) with two UIViewControllers subclassed from the main one.
I have a subclassed UIViewController that's acting as an ABPeoplePicker Navigation Controller Delegate. This
I have subclassed UIViewController into a new class, PageViewController (I'm writing a simple book
I have a UIViewController subclass that I am trying to have handle the shake
I have a Card class subclassed from UIView and a Deck class from NSObject.
Say I have 2 subclasses from UIViewController , class A and class B .
I have a UITabBarController, and each tab handles a different UIViewController that pushes on
I have subclassed MPMoviePlayerController... @interface CustomMoviePlayerController : UIViewController { NSURL *movieUrlPath; MPMoviePlayerController *mp; ...
I have subclassed UIView and created a NIB that controls the main logic for

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.