Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
- {
- static NSString *cellIdentifier = @"Cell";
- UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier];
- if (cell == nil)
- {
- cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:@"Cell1"];
- [cell clearsContextBeforeDrawing];
- UIButton *btn = [UIButton buttonWithType:UIButtonTypeRoundedRect];
- btn.frame = CGRectMake(5,220,70, 30);
- [btn setTitleColor:[UIColor blackColor] forState:UIControlStateNormal ];
- [btn setTitle:[NSString stringWithFormat:@"button == %ld",(long)indexPath.row] forState:UIControlStateNormal];
- btn.tag = indexPath.row;
- [btn addTarget:self action:@selector(methodOfButton:) forControlEvents:UIControlEventTouchUpInside];
- [cell.contentView addSubview:btn];
- }
- return cell;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement