Hi,
Is there any way to change the cell.detailTextLabel from the app? For example, the user have to choose gender, I would like to display the selected gender under the detailTextLabel
Thanks!
Hi,
Is there any way to change the cell.detailTextLabel from the app? For example, the user have to choose gender, I would like to display the selected gender under the detailTextLabel
Thanks!
EDIT:
You shouldn't access cell.detailTextLabel directly in the code of another class. What you should do is to have an array of properties to set.
You can set the like [myMutableArray replaceObjectAtIndex:myIndex withObject:@"USER_SELECT"];
then you call
[self.tableView reloadData];
and inside the method
- (UITableViewCell *)cellForRowAtIndexPath:(NSIndexPath *)indexPath {
cell.detailTextLabel.text = [myMutableArray objectAtIndex:indexPath.row];
}
You have access to all the properties of cell.detailTextLabel in code.
Note: You probably want to do all this in cellForRowAtIndexPath:.
is user changing gender inside the table ?? then I believe you have to reload the table.. and in the cellForRowAtIndex method...
show the label for the desired row... do this in if condition... as if user has selected gender it will show selected else it will show choose gender...