2017-04-27 16 views
0

私はサブクラスが親クラスを継承しますがサブクラスはtableView(: UITableView, cellForRowAt: IndexPath) -> UITableViewCellプロトコルで初期化するとxibのサブビューが見つかりません行う?iOSサブクラスは親クラスのXibファイルを継承します

override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { 
    //let cell = tableView.dequeueReusableCell(withIdentifier: "reuseIdentifier", for: indexPath) 
    let firstCell = FirstTableViewCell.init(style: .default, reuseIdentifier: "cell") 

    firstCell.test.text = "subCell" 
    return firstCell 
} 
+1

コードを表示できますか? – Paulw11

+1

コメントにコードを投稿しないでください。 [編集]あなたの質問。 – rmaddy

+0

最初のセルはBaseTableViewCellを継承し、BaseTableViewCellにはxibファイルがありますが、最初のセルには –

答えて

0

xibを読み込むためにinit関数を上書きする必要があります。

関連する問題