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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T05:15:44+00:00 2026-06-02T05:15:44+00:00

Using xcode 4.2 for iPhone app, without ARC — When I create an outlet

  • 0

Using xcode 4.2 for iPhone app, without ARC —

When I create an outlet using the interface builder xcode adds two lines of code to my viewController. One in viewDidUnload: — [self setMyOutlet:nil] and second in dealloc — [myOutlet release].

I understand the latter (the release). But why set the outlet to nil in viewDidUnload. Doesn’t viewDidUnload get called before dealloc and won’t setting the outlet to nil negate the release operation in dealloc? Setting to nil makes sense I would think for building a Mac application which is using garbage collection — but it doesn’t make sense for an iPhone app.

Why does the interface builder do this? Should I delete the lines which set the outlets to nil?

  • 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-06-02T05:15:46+00:00Added an answer on June 2, 2026 at 5:15 am

    viewDidUnload may be called and may be not called. It depends on the current memory usage. dealloc is a place where you should clean all your properties (like arrays, custom objects). In viewDidUnload you clean views and perhaps objects created to support the view. viewDidUnload mean that your view is unloaded (but not whole view controller) and it may be created and loaded again (in viewDidLoad, of course) in the future.

    • Why to nil – Objective-C Difference between setting nil and
      releasing
    • Understanding How Views Are Loaded and
      Unloaded
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using xcode 4.2 with storyboard to create an iphone app. When I
I'm trying to create an iPhone app using xcode, and I want to know
I'm creating an iphone app using xcode 4.2, and trying to use the AVFoundation
I am developing an iPhone app and are using xCode to do Build and
When you are using Xcode to make an iPhone app, how do you change
I am currently creating an iPhone app using Xcode 4.0.2, I want the app
I am developing an iphone app using xcode. I would like to automate the
I'm trying to compile an iPhone app that uses CorePlot. I'm using XCode 4.
I started today to upgrade my iPhone-App to an Universal-App. So I'm using Xcode
I am using XCode 4.2 to develop an iPhone App , I am new

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.