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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T12:55:41+00:00 2026-05-30T12:55:41+00:00

I have a form with various controls. One of these controls lets the user

  • 0

I have a form with various controls. One of these controls lets the user change the category of the form being submitted via a modal view that appears after tapping on the control. When the user makes a selection to change the category of the form, the form needs to re-display the controls based on the new category.

Other than removing the previous controls from the form’s view, is there anything I need to worry about in regards to the controls that are being discarded? Consider the following method that the form implements:

- (void)showControls
    self.controls = [NSMutableArray array];

    for(UIControl *control in self.dataSource.controls){
        [self.controls addObject:control];
        [self.view addSubview:control];
    }
}

If I call this method multiple times (because the user changes the form category, as described earlier), I assume it results in various NSMutableArrays floating around without any pointers that reference them. Is this ok to do? I’m using ARC, so will it automatically collect those “lost” arrays?

  • 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-30T12:55:42+00:00Added an answer on May 30, 2026 at 12:55 pm

    ARC doesn’t “collect” anything. Also, what you’re doing there is fairly irrelevant that ARC is being used. You’re using the setter for the control property which will work in the same way as pre-ARC. It will release the old value and retain the new value. So, you shouldn’t have any problems with the arrays being “lost”, unless you do weird things with self.controls other than what you’ve shown.

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

Sidebar

Related Questions

Say we have a form where the user types in various info. We validate
I have a form showing the details of a client (various controls), along with
I have a form with various fields the user need to feel out with
I have a Web Content Form containing a Div and various Server controls like
I have a WPF window / form with various controls. I have set the
I have am HTML form in a PHP page. The form has various inputs.
Javascript I have code that will hide various sections in a MS CRM form
I have form where user submits field. Field can have letters, numbers, and punctuation.
i have form with user data to input and javascript ajax to send information
I've got a C# form, with various controls on it. The form controls an

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.