我在 Mainclass 中有一个 UILabel,现在我想通过 Subclass 函数为其分配文本。我的问题详细代码可在此处链接现在我希望当我单击 UITableview 的任何单元格(这是我的子类)时,其文本分配给 Mainview 中的 UILabel。我的代码低于我尝试过的代码
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
UITableViewCell *selectedCell = [tableView cellForRowAtIndexPath:indexPath];
NSString *cellText = selectedCell.textLabel.text;
NSLog(@"MY row Text:%@",cellText);
// Now here I don't know how we can pass this text to UILabel which is in my mainclass
}
我的下图也有助于理解我的问题