1
상단에는 이미지보기가 있고 가운데에는 TableView가있는보기 컨트롤러가 있습니다. TableView에는 4 개의 섹션이 있고 각 섹션에는 1 - 5 개의 셀이 있습니다. 그것은 다음과 같습니다 : http://imgur.com/GMIhQdt 각 셀에 segue를 추가하고 싶습니다.TableView에서 여러 개의 단절을 수행하는 방법은 무엇입니까?
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
if (indexPath.section == 0 && indexPath.row == 0) {
[self performSegueWithIdentifier:@"segue1" sender:self];}
if (indexPath.section == 0 && indexPath.row == 1) {
[self performSegueWithIdentifier:@"segue2" sender:self];}
[...]
}
하지만 각보기 컨트롤러에 CellIdentifier = @"Cell"
와 세포를 연결하지 못했습니다 :
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
if (indexPath.section == 0 && indexPath.row < 3) {
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
cell.textLabel.textColor = [UIColor darkGrayColor];
if (indexPath.section == 0 && indexPath.row == 0) {
cell.textLabel.text = @"London";}
if (indexPath.section == 0 && indexPath.row == 1) {
cell.textLabel.text = @"Tokyo";}
if (indexPath.section == 0 && indexPath.row == 2) {
cell.textLabel.text = @"Paris";}
}
[...]
return cell;
}
그리고 나서 각 셀에 SEGUE를 추가하려고합니다. Storyboard에서 하나의 셀에서 다른 뷰 컨트롤러로 여러 개의 Segue를 설계하는 것은 불가능합니다. 어떻게 할 수 있습니까? 감사합니다.