I think if you made the label and button are fields of the custom cell you made. Then make the action handler also on the custom cell, you will be able to access the label easily.
It would be something like that:
海关
UIButton *button;
UILabel *label;
-(IBAction) updateLabel:(id) sender;
海关
<>Update>
//[button addAction:@selector(updateLabel) target:self];
-(IBAction) updateLabel:(id) sender{
[self.label setText:@" text"];
}
You can Implement the custom cell using Interface Builder. You can also connect the action to the button from Interface Builder as well, you will need to move the action prototype to the header file. Make the file owner the ViewTableController to load that cell.
Then make an outlet for your custom cell on the TableViewController and on the delegate method you can load the custom cell like that:
// Customize the appearance of table view cells.
- (UITableViewCell *)tableView:(UITableView *)table_view cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *cell_identifier = @"Cell";
CustomCell *cell;
cell=(CustomCell*)[table_view dequeueReusableCellWithIdentifier:cell_identifier];
if (cell==nil) {
self.customCell=nil;
[[NSBundle mainBundle] loadNibNamed:@"custom_cell" owner:self options:nil];
cell=self.customCell;
}
}