3
我有兩個分組部分,每個部分都包含一個單元格視圖。點擊時,我需要一個單元格去一個場景,另一個單元格去另一個單元格。我已經從主視圖控制器到另外兩個場景設置了segues,現在我需要指示程序在單擊正確的單元格時觸發segue。以編程方式從動態單元格觸發segue
我認爲這必須發生在我的代碼的每個部分都是自定義的區域。
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath;
{
UITableViewCell *serverLocCell = [tableView dequeueReusableCellWithIdentifier:@"serverLocation"];
switch (indexPath.section) {
case 0:
serverLocCell.textLabel.text = testLocation;
serverLocCell.detailTextLabel.text = @"Change";
break;
case 1:
serverLocCell.textLabel.text = @"Speed Test";
serverLocCell.detailTextLabel.text = @"Change";
break;
default:
break;
}
return serverLocCell;
}
我想我也需要這樣的功能:
self preformSegueWithIdentifier
但是不能很指甲挫正確的密碼/位置。
兩個seg都有自己的標識符。