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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T18:52:45+00:00 2026-06-05T18:52:45+00:00

In my iphone app i am having a button, when I click on the

  • 0

In my iphone app i am having a button, when I click on the button, download operation starts and i am replacing the button with UIProgressView. This UIProgressView will show the download progress. But once a UIProgressView is added, when I scroll it is disappeared. Here is my code:

    // Customize the appearance of table view cells.
    - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
    {
        static NSString *CellIdentifier = @"Cell";

        UIMenuItemCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];

        if(cell == nil)
            cell = [self getCellContentView:CellIdentifier];

        cell.cellitemImage = (UIImageView *)[cell viewWithTag:2];
        cell.cellItemButton = (UIButton *)[cell viewWithTag:3];

        DataBaseClass *itemObj = [appDelegate.itemArray objectAtIndex:indexPath.row];
        NSString *url;
        if([itemObj.itemStatus isEqualToString:@"Available"]){
            cell.cellItemButton.userInteractionEnabled = YES;
            cell.userInteractionEnabled = YES;
            [cell.cellItemButton setTitle:@"" forState:UIControlStateNormal];
            [cell.cellItemButton setBackgroundImage:[UIImage imageNamed:@"img_normal"] forState:UIControlStateNormal];
            [cell.cellItemButton setBackgroundImage:[UIImage imageNamed:@"img_pressed"] forState:UIControlStateHighlighted];
            [cell.cellItemButton addTarget:self action:@selector(download) forControlEvents:UIControlEventTouchUpInside];
            url = [NSString stringWithFormat:@"%@",itemObj.availableIcon];
        }else if([itemObj.itemStatus isEqualToString:@"Downloading"]){
            url = [NSString stringWithFormat:@"%@",itemObj.availableIcon];
            [cell.contentView addSubview:myprogressView];
            cell.cellItemButton.hidden = YES;
        }

        [cell.cellitemImage setImageWithURL:[NSURL URLWithString:url] placeholderImage:[UIImage imageNamed:@"item01.png"]];

        cell.cellItemName.text = [NSString stringWithFormat:@"%@",itemObj.itemName];

        return cell;
    }

- (void)download{
        UIButton *btn = (UIButton *)clickedBtnSender;
        UIMenuItemCell *cell = [(UIMenuItemCell *)[[clickedBtnSender superview] superview] retain];
         myprogressView = [[[CustomProgressView alloc]initWithFrame:CGRectMake(25, 140, 100, 21)] retain];
        myprogressView.tag = selectedTag;

        btn.hidden = YES;

        for (UIProgressView *currentProgress in cell.contentView.subviews) {
            if ([currentProgress isKindOfClass:[UIProgressView class]]){
                [currentProgress removeFromSuperview];
            }
        }

        [cell.contentView addSubview:myprogressView];
}

Please help.

EDIT

- (UIMenuItemCell *) getCellContentView:(NSString *)cellIdentifier {

    CGRect CellFrame = CGRectMake(0, 0, 150, 60);
    CGRect imgFrame = CGRectMake(20, 48, 110, 123);
    CGRect btnFrame = CGRectMake(25, 140, 100, 26);
    CGRect progressFrame = CGRectMake(25, 140, 100, 21);


    UIImageView *itemImg;
    UIButton *itemBtn;
    UIProgressView *itemProgView;

    UIMenuItemCell *cell = [[UIMenuItemCell alloc] init] ;
    cell.frame = CellFrame;

    //Initialize ImageView
    itemImg = [[UIImageView alloc]initWithFrame:imgFrame];
    itemImg.tag = 2;
    [cell.contentView addSubview:itemImg];

    //Initialize Button
    itemBtn = [UIButton buttonWithType:UIButtonTypeCustom];
    itemBtn.frame = btnFrame;
    itemBtn.tag = 3;
    itemBtn.titleLabel.textColor = [UIColor blueColor];
    itemBtn.titleLabel.font = [UIFont systemFontOfSize:9.0];
    [cell.contentView addSubview:itemBtn];

    //Initialize ProgressView
    itemProgView = [[CustomProgressView alloc]initWithFrame:progressFrame];
    itemProgView.tag = 4;
    //[cell.contentView addSubview:itemProgView];

    return cell;
}
  • 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-05T18:52:47+00:00Added an answer on June 5, 2026 at 6:52 pm

    I think you need to have unique cellIdentifier for each cell

    - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
    {
            NSString *CellIdentifier = [NSString stringWithFormat:@"Cell%d", indexPath.row];
    
            UIMenuItemCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
    
            if(cell == nil) {
                cell = [self getCellContentView:CellIdentifier];
    
                // Some codes here
            }
    
           return cell;
    }
    

    Additional based on you last edit

    Change

    UIMenuItemCell *cell = [[UIMenuItemCell alloc] init];
    

    to

    UIMenuItemCell *cell = [[UIMenuItemCell alloc] initWithFrame:CellFrame reuseIdentifier:cellIdentifier];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I just created an iPhone app and am having friends try it out, but
I'm having a problem with building my iPhone app..so, i finally finished it, but
I am creating an iphone app and i am having some issues with drawing
Im having a problem opening the settings preferences in my IOS iphone app. At
I am working on an iphone (iOS 4.0 or later) app and having some
I have an IPhone application which is having a non consumable in app purchse
i'm a newbie to iphone development. I'm doing a navigation-based app, and I'm having
I'm having trouble getting my mobile web app to render properly on my iPhone
I'm having some trouble with an iPhone app that I'm making. I have two
I'm trying to test in app purchases in our app but I'm not having

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.