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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T16:02:07+00:00 2026-05-27T16:02:07+00:00

I have recently began creating iOS applications completely programmatically (without the interface builder) and

  • 0

I have recently began creating iOS applications completely programmatically (without the interface builder) and was wondering if there was any advantage/difference in declaring a ViewController’s view as a property before using it versus simply creating at the loadview function. Also, would I dealloc the view inside of the controllers dealloc if I am using it as a property?

i.e. this

- (void)loadView
{
    _rootView = [[RootView alloc] initWithFrame:CGRectZero];
    [self setView:self.rootView];
}

vs.

- (void)loadView
{
    RootView *rootView = [[RootView alloc] initWithFrame:CGRectZero];
    [self setView:rootView];
    [rootView release];
}
  • 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-27T16:02:08+00:00Added an answer on May 27, 2026 at 4:02 pm

    view already is a property of UIViewController. Declaring an extra property such as rootView in your example would be pointless. So your second example would be the way to go. (I’m not sure why you’d want to create a view with a width and height of zero, but that’s another story.)

    In this case, your dealloc implementation (if you provide one) should call [super dealloc] to ensure that the view property is sent a release message, but of course you should always call [super dealloc] in any overridden implementation of dealloc.

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

Sidebar

Related Questions

I recently began using BIRT and have developed a report to use with my
I've recently began using dTrace and have noticed just how awesome it is. Its
Recently I've been doing lots of weekend coding, and have began to really need
I have recently upgraded some of my web applications to ASP.NET 3.5 by installing
While I'm fine with standard control styling in silverlight I have recently began using
I recently have began using prepared statements again in a web application, and I
Our company recently began creating CVS branches to mark each release. Formerly we had
I have recently begin creating an image editing tool which will cater to a
We have several applications that use Apache HTTPClient 3 to make HTTP requests. Recently
I recently began exploring Scapy. A wonderful tool indeed! I have a problem... When

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.