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 7588767
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T20:00:16+00:00 2026-05-30T20:00:16+00:00

I thought that I should never call [super loadView] but something is confusing me.

  • 0

I thought that I should never call [super loadView] but something is confusing me.

In description of loadView (UIViewController Class Reference) it is said that “Your custom implementation of this method should not call super.”,
but in ZoomingPDFViewer example that they gave, loadView implementation (ZoomingPDFViewerViewController) is calling [super loadView].

I have tried to call it from my loadView method and it works ok, but I just don’t understand then what does it mean to not call super.

  • 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-30T20:00:17+00:00Added an answer on May 30, 2026 at 8:00 pm

    You definitely should not be calling [super loadView]. I’d say you found a bug in the ZoomingPDFViewer example.

    You override loadView when you want to programatically create the view hierarchy for your view controller (not using a xib).

    As you pointed out, the docs clearly state that you should not call super.

    Your custom implementation of this method should not call super.

    I assume this is to avoid loading both from a xib and programatically creating a view as this method is used by the base to load a view from a xib:

    If the view controller has an associated nib file, this method loads
    the view from the nib file.

    Note also that even if during allocation of your UIViewController object you pass nil for the nibNameOrNil parameter that the UIViewController implementation of loadView will try to load any xib with the associated class name in it.

    A view controller has an associated nib file if the nibName property
    returns a non-nil value, which occurs if the view controller was
    instantiated from a storyboard, if you explicitly assigned it a nib
    file using the initWithNibName:bundle: method, or if iOS finds a nib
    file in the app bundle with a name based on the view controller’s
    class name.
    If the view controller does not have an associated nib
    file, this method creates a plain UIView object instead.

    The real intent of this method is to give you full control of building the view hierarchy without relying on the built in xib loading mechanism.:

    You can override this method in order to create your views manually.

    Personally, I override loadView if: 1.) The xib I would make for it is really trivial or 2.) The layout of the control is very dynamic, so creating a xib with a static layout has little benefit.

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

Sidebar

Related Questions

I have always thought that the .equals() method in java should be overridden to
I thought that to clone a List you would just call: List<int> cloneList =
I have never thought that writing a simple two column layout is so complicated
I thought that there was some way in .net 3.0 to give an array
I thought that it would be fun to present some classic CS problems and
I thought that I'll be clever and use subquery to get my report in
I thought that compiled queries would perform the same query translation as DataContext. Yet
I thought that a delegate instance was interchangeable with a function instance. Take the
I thought that by default my Regex would exhibit the greedy behavior that I
I thought that calling BeginInvoke more than once on the same delegate instance would

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.