Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

RashiMahajan

macrumors newbie
Original poster
Apr 17, 2009
22
0
Hi,
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 :(
 
Can you post code of

Code:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath 
{
}

so we can help you properly

Thanks :)
 
Code:
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];
indicator.tag=indexPath.row;
[ 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 :(
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.