JSON Decoder 활용하기 영상 우측 하단에 자막 스크립트 ON 설정을 한 후 강의를 시청하시면 학습에 도움이 됩니다.JSONDecoder를 활용하여 JSON 데이터를 Swift 인스턴스로 디코드하여 테이블뷰에 보여주는 실습을 해봅니다.
comment
friends.json 파일은 Any 파일위에서 마우스 오른쪽 클릭 - open with external editor 하니까 열리네용
2019년 들어와서 tableview에 detailtextLabel은 그냥 강의에서 나오는것 처럼하면 안됩니다.
var cell = tableView.dequeueReusableCell(withIdentifier: "cell", for: indexPath)
if cell == nil || cell.detailTextLabel == nil {
cell = UITableViewCell(style: .subtitle, reuseIdentifier: "cell")
}
이렇게 추가해서 하면 동영상과 같은 작동을 합니다.
질문 드립니다!!!
viewDidLoad에서 'friends'라는 에셋을 가져올때, 파일을 못 읽어오네요.
콘솔에는 "The data couldn’t be read because it is missing." 라는 에러만 나오구요.
코드는 여러번 테스트를 해봤는데 이상이 없고, 파일도 비어있지 않은것을 확인했는데, 왜 이러는 걸까요?
비공개 글입니다.
비공개 글입니다.