에 개체를 추가 신호 SIGABRT 나는 세 가지 클래스를 정의 :스위프트와 영역 : 점점 스레드 1 : 목록
CoffeeBrand :
dynamic var brandName = ""
let brands = List<Coffee>()
커피 :
dynamic var name = ""
let cupAmount = List<CoffeeCup>()
CoffeeCup :
dynamic var cup = 0
dynamic var caffeine = 0
그리고 시도해보고 싶습니다. 이 테이블처럼 얼마나 시도하는 브랜드 스타 벅스는
class CoffeeListsTableViewController: UITableViewController {
// MARK: Properties
var brands: Results<CoffeeBrand>!
override func viewDidLoad() {
super.viewDidLoad()
let Starbucks = CoffeeBrand(value: ["Starbucks",["Iced Latte", [200,150],[500,150]]])
try! realm.write() {
realm.add(Starbucks)
}
}
}
을 볼하지만 내가 가진 것은 "스레드 1 : 신호 SIGABRT"이며, 나는이 내가 구글 스레드 1 (없이 작업해야한다고 생각한다는 조사 이의 테이블 데이터 소스로) 다른 사람의 questiones에서 뭐가 잘못
를 찾아보십시오 : 해당 코드의 모습에서
override func numberOfSections(in tableView: UITableView) -> Int {
// #warning Incomplete implementation, return the number of sections
return 1
}
override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return brands.count
}
override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell{
//let cellIdentifier = "CoffeeBrandTableViewCell"
let cell = tableView.dequeueReusableCell(withIdentifier: "CoffeeBrandTableViewCell", for: indexPath) as! CoffeeBrandTableViewCell
// in my cell, only a label of brandName
let brandList = brands[indexPath.row]
cell.brandName.text = brandList.brandName
return cell
}
아니, 그게 문제가 아니에요, 전에 이걸 시도해 보면 "Thread 1 : EXC_BAD_INSTRUCTION" – whatever123