I have a UITableView with CustomCell. The custom cells contain a UILabel and a UIImageView.
I saw online that it is possible to get the text from a normal UITableView cell and store it in a string when the user presses the cell.
But how can you do this when you are using a custom cell? Becuase the name of my UILabel is "type_label" and it has been defined in the header file of my CustomCell XIB.
So in Xcode I can't use:
cell.type_label.text"
In the following function:
-(void)tableView:(UITableView *) tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
Thanks, Dan.
In the tableViewDidSelectRow all you need to do is:
UITableViewCellCustomClass *customCell = (UITableViewVellCustomClass*)[tableView cellForRowAtIndexPath:indexPath];
NSString *labelText = [[customCell type_label] text];
That should get you want you need.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With