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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T20:40:40+00:00 2026-05-26T20:40:40+00:00

Does these two snippets accomplish the same thing? Assuming I have three IBOutlet UIButtons

  • 0

Does these two snippets accomplish the same thing? Assuming I have three IBOutlet UIButtons in my interface file called buttonOne, buttonTwo, and buttonThree:

- (void)dealloc {
    for(UIButton* idx in self.view.subviews)
        [idx release], idx = nil;

    [super dealloc];
}

and

- (void)dealloc {
    [buttonOne release], buttonOne = nil;
    [buttonTwo release], buttonTwo = nil;
    [buttonThree release], buttonThree = nil;
    [super dealloc];
}

Edit:

As ARC sometimes seems like a fix-all alternative to memory management in iOS, I prefer not to use it because a) I feel like I’m cheating and b) if I am not mistaken, it only works on iOS 5 devices.

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

    Assuming you don’t have any other subviews, those two pieces of code do the same thing. But it’s not a thing you should do.

    You should declare your outlets weak (if using ARC) or assign (if not using ARC). Then you don’t have to release them in dealloc. A UIView retains its subviews and releases them when it is deallocated, so you don’t need to retain or release them. You just release self.view (or, if you’re a subclass of UIViewController, you let [super dealloc] take care of releasing self.view).

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

Sidebar

Related Questions

These two code snippets produce files with different file-permissions. Example 1 creates the expected
I have these two snippets of code (written in Java) which is more more
If I have two yield return methods with the same signature, the compiler does
I'm comparing these two tools. The impression I have is: Inno Setup does not
Has anyone ever tested, or does anyone know, the performance differences of these two
I'm hoping someone here can answer these definitively: Does putting a VHD file in
Does anyone have any suggestions for creating meta tables in a database? These tables
I have these two pieces of code. The first one works perfectly: UIView *tmp
I have some Scala code that does something nifty with two different versions of
Is there a difference between these two create table snippets? One includes CONSTRAINT keyword,

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.