Button images in cellForRowAtIndexPath are not getting refreshed

Discussion in 'iOS Programming' started by RashiMahajan, Nov 22, 2009.

  1. RashiMahajan macrumors newbie

    Apr 17, 2009
    In my prgm, i am displaying button to some filtered rows of the table in "cellForRowAtIndexPath", for first few rows it display the button to the filtered rows bt as i scroll up, some other rows which dont satify the filetring condition also display the button

    What i think they dispying the button images coz if previous rows cell contained the images ......
    please help me :(
  2. sneha macrumors newbie

    May 24, 2009
    Can you post code of

    - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath 
    so we can help you properly

    Thanks :)
  3. RashiMahajan thread starter macrumors newbie

    Apr 17, 2009
    So nice of u sneha :)
    i will post the code soon bt lpz be there to help me :)
  4. RashiMahajan thread starter macrumors newbie

    Apr 17, 2009
    if([some condition])
     UIButton *indicator	=	[[UIButton alloc]initWithFrame:CGRectMake(10, 30, 40, 40)];
    [indicator setBackgroundColor:[UIColor greenColor]];
    [indicator addTarget:self action:@selector(selectionBtnClick:) forControlEvents:UIControlEventTouchUpInside];
    [ cell.contentView addSubview:indicator];
    [indicator release];
    This is my code inside "cellForRowAtIndexPath" Now for first 5-6 records its display the button properly if row specifies the condition But when i scroll up in table view , for new rows which don't specify the condition, even they display the button & if i press the button , it traces the previous buttons tag :(
    So i am not able to get teh fresh new table rows whn i scroll up the table :(

Share This Page