In my application i have created a UIViewController page in that i have taken a table.
by customized that table i have created a add button in each cell of that table.
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if(cell == nil) {
[[NSBundle mainBundle] loadNibNamed:@"CustomBuddy" owner:self options:nil];
cell = self.customCell;
self.customCell = nil;
}
cell.text = (NSString *)[names objectAtIndex:indexPath.row];
return cell;
}
and add action to the add button
-(IBAction)addButtonClicked
{
NSLog(@"Add button clicked");
}
now in this add button i want to get the name exist in the cell.
how can i do this please help me out….
You could assign the tag for your Add button during your
tableView:cellForRowAtIndexPathcreation. Then you can just readout the Add button tag when it’s triggered. By the way, it should be-(IBAction) addButtonClicked:(id) sender