I have a tableview in uiviewcontroller, it has a custom cell where I set label to get the value from my mysql database. everything works ok but I want to get when the user tap in a row, to go to another uiviewcontroller according the info I have in the label ID. Im going to place the code Im using, question is: this is the right way to do it? I was wondering when the user tap in the row Im creating only one instance of label and reusing it or it's creating a new one every time the user tap the row and make memory leaks in my app?
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
UITableViewCell *rowSelected = [tableView cellForRowAtIndexPath:indexPath];
UILabel *checkSelected = (UILabel *)[rowSelected viewWithTag:1];
if ([checkSelected.text isEqualToString:@id: 1
// ... do my code
// ... return msg uialert