Xcode 6을 사용하고 iOS 8을 대상으로하며 Swift에서이 코드를 사용하고 있습니다.Segue가 수행되지 않습니다. iOS8
내 스토리 보드 컨트롤러는 다음과 같다 :
Tab Bar > Navigation > Table View > Detail View
Show Detail
SEGUE는 Detail View
에 Table Cell
에서입니다.
prepareForSegue
메서드는 표 셀을 클릭 할 때 트리거되지 않습니다. 버튼에서 디테일까지 세그 (Segue)는 잘 작동합니다. (didSelectRowAtIndexPath
)도 문제가 없습니다.
나는이 문제를 테스트하는 새로운 테스트 프로젝트를 생성 한 - 컨트롤러 코드는 다음과 같습니다
import UIKit
class TestTableController: UITableViewController
{
override func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int
{
return 2;
}
override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell
{
let cellId = "testCell";
var cell: UITableViewCell? = tableView.dequeueReusableCellWithIdentifier(cellId) as? UITableViewCell;
if (cell == nil)
{
cell = UITableViewCell(style: UITableViewCellStyle.Default, reuseIdentifier: cellId);
}
cell!.textLabel!.text = "cell \(indexPath.item)";
return cell!;
}
}
어떤 생각이 왜 상자 밖으로 작동하지 않는 이유는 무엇입니까?
P.:Tab Bar
대신 Split View
을 사용하면 동일한 세그 효과가 잘 적용됩니다.
8.0.x에서 segues (특히 unwind segues)와 관련하여 많은 문제가 있었지만 지금은 모두 수정되었으므로 Xcode 6/iOS 8.1을 실행하고 있는지 확인하십시오. – Rog