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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T22:51:16+00:00 2026-05-20T22:51:16+00:00

I have a view with many retained IBOutlets, loaded from a XIB. I have

  • 0

I have a view with many retained IBOutlets, loaded from a XIB.

I have read that they have to be released when the controller’s dealloc method is called.

May I use a cycle to do this(also to avoid releasing each outlet separately)?

something like

for(UIView *v in self.view.subviews){
[v release];
v=nil;
}

?

also, after that, should I release the view as well?

  • 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-20T22:51:17+00:00Added an answer on May 20, 2026 at 10:51 pm

    That would only make sense if you’ve actually retained every single subview, and even then it seems like asking for trouble — if you ever wanted to change your .xib, you’d have to remember to update you code as well. And there may also be non-view objects in a nib that can be connected to outlets, like view controllers.

    There are only so many views you can fit on an iPhone- or iPad-sized screen, so it’s hard to imagine that you have more than a few dozen outlets. I think the prudent thing to do here is to simply release each one separately. This is what and iOS developer would expect to see, and it won’t be any slower than using a loop. It’ll be more code, yes, but the code will be easy to understand.

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

Sidebar

Related Questions

I have a view controller that can fetch many different types of entities from
I have the problem that my view controller class has too many delegates and
I have a list view with many rows and have it set so that
I have a view with a div that is looped many times. Each of
I have View Controller with a (navigation controller) that can flip between 2 views
I have a table view that has many cells. Each cell has its own
I have a view model that needs to encapsulate a couple of many-to-many relationships.
I have a view that has many textfields and values inserted into them. Now
I have a view that contains many partial views and I need to pass
I have a view that will have many controls to filter the interface (or

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.