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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T18:49:47+00:00 2026-05-27T18:49:47+00:00

Under iOS 5, I encounter the following problem : the following code is called

  • 0

Under iOS 5, I encounter the following problem : the following code is called on a controller everytime a new product is picked in the application. It displays a bullet list of features in the controller’s view.

Every bullet is an image that is added at the right place (in front of the corresponding text).

Now, the problem is that sometimes, apparently randomly, some bullets are not removed from the previous bullet lists, altough I remove it from its superview at the beginning of the methods.

  - (void) loadProduct{
    for (UIView * bullet in bullets){
        bullet.hidden = YES;
        [bullet removeFromSuperview];
    }
    [bullets removeAllObjects];
    [self.view setNeedsDisplay];


   ......here some stuff ......


    for (int i=0;i< numberOfFeatures;i++)
    {   

            UIImageView * bullet = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"bullet.png"]];
            bullet.frame =CGRectMake(someFloatValue ,
                                     someOtherFloatValue,
                                     6,
                                     6);
            [self.view addSubview:bullet];

            [bullets addObject:bullet];
            [bullet release];

        }
    }

bullets is an NSMutableArray, a property of the controller.

Am I doing something wrong here?

  • 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-27T18:49:48+00:00Added an answer on May 27, 2026 at 6:49 pm

    In bullets it seems that you’re only storing the labels:

    [bullets addObject:label];
    

    So, when removing everything from bullets, you’re only removing the labels from the superview, the bullets (UIImageView controls) are left there.

    It might be easier if you create a custom control (a view holding both the bullet and the label) and use those instead

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

Sidebar

Related Questions

The following code displays an odd behavior under iOS 4.3 (maybe others version too).
The following code (sorry for the length) displays an odd behavior under iOS 4.3
Under what circumstances will the False part of the following code be executed? x
Under Linux, my C++ application is using fork() and execv() to launch multiple instances
I am storing a username in CFPreferencesCopyAppValue. Under iOS 3.1.3 it works as expected
Platform: iOS with TCP/IP comms. The following is an example of my incoming data
(iOS) I have a view that contains multiple textviews under static headings (see image
As seen in this page: http://developer.apple.com/ios/manage/distribution/index.action , under the Create and download your iOS
I have to perform some 2D transforms under iOS. I know that you can
I have an iOS project which builds and executes as expected under debug yet

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.