행복한 세상의 니노

xcode - unable to dequeue a cell with idenifier cell - must register a nib or a class for the idenifier or connect a prototype cell in a storyboard 본문

카테고리 없음

xcode - unable to dequeue a cell with idenifier cell - must register a nib or a class for the idenifier or connect a prototype cell in a storyboard

니노z 2021. 4. 23. 22:38

문제 :  

 

문제코드 :

    func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
        
        let cell = tableView.dequeueReusableCell(withIdentifier: "cell", for: indexPath)
        
        return cell
    }

 

 

해결방법 :

 

1. 스타일 추가

2. 코드변경

    func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
        
        let cell = tableView.dequeueReusableCell(withIdentifier: "cell", for: indexPath) as UITableViewCell
        
        return cell
    }

 

반응형