我有一個ViewController,它有一個TableView,我想從didSelectRowAtIndexPath中獲取值,所以我可以傳遞給另一個視圖。在方法外部獲取值
這是方法:
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
// That's the string that I want to get the value
NSString *selectRow = [_vinhoArray objectAtIndex:indexPath.row];
stringTest = selectRow;
}
創建和綜合物業stringTest
@property (nonatomic, strong) NSString *stringTest;
@synthesize stringTest;
的值從selectRow轉讓,但我想我做錯了什麼。因爲這不起作用。
有人可以幫助我嗎?由於
那麼它是'stringTest'還是'stringTeste'? – sha
@sha ** stringTest **!對不起,輸入錯誤。 –