- (UITableViewCell *) getCellContentView:(NSString *)cellIdentifier{
UIButton * mp;
UILabel *l1;
UITableViewCell *cell=[[[UITableViewCell alloc]initWithFrame: CGRectMake(0, 0, 300, 60) reuseIdentifier:nil] autorelease];
l1=[[UILabel alloc] initWithFrame:CGRectMake(100.0, 15.0, 400.0, 40.0)];
l1.tag=1;
l1.font=[UIFont fontWithName:@"AppleGothic" size:17];
l1.textColor=[UIColor blackColor];
l1.backgroundColor=[UIColor clearColor];
l1.numberOfLines=3;
[cell.contentView addSubview:l1];
[l1 release];
mp=[[UIButton alloc] initWithFrame:CGRectMake(250, 25, 50, 20)];
mp.tag=2;
mp.font=[UIFont boldSystemFontOfSize:14];
mp.textColor=[UIColor blueColor ];
[mp addTarget:self action:@selector(mapbtnpressed:) forControlEvents:UIControlEventTouchUpInside];
[cell.contentView addSubview:mp];
[mp release]
return cell;
}
в методе cellForRowAtIndexPath, вызываемом
cell=[self getCellContentView:CellIdentifier];
labelname=(UILabel *)[cell viewWithTag:1];
[cell.contentView addSubview:labelname];
click event
+
labelname.text=[NSString stringWithFormat:@"%d",[lanename.text intvalue]+1];
-event
labelname.text=[NSString stringWithFormat:@"%d",[lanename.text intvalue]-1];