Objective C: Error Pada Bagian Thread 1 Program Received Signal SIGABRT


Pada saat saya belajar iOS saya menemukan error ketika diklik tanda (+) maka muncul error pada gambar dibawah ini:


Berikut tampilan errornya:


Saya periksa juga outputnya: 

2013-05-24 15:17:15.661 ScaryBugs[1055:c07] *** Assertion failure in -[UITableView dequeueReusableCellWithIdentifier:forIndexPath:], /SourceCache/UIKit_Sim/UIKit-2380.17/UITableView.m:4460
2013-05-24 15:17:15.663 ScaryBugs[1055:c07] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'unable to dequeue a cell with identifier Cell - must register a nib or a class for the identifier or connect a prototype cell in a storyboard'
*** First throw call stack:
(0x1c94012 0x10d1e7e 0x1c93e78 0xb67665 0xc76c4 0x26c8 0xd08fb 0xd09cf 0x275f30 0x2807e2 0xbb016 0xb7617 0xc41f6 0xc4235 0x252b 0x10e5705 0x192c0 0x255a64 0x10e5705 0x192c0 0x19258 0xda021 0xda57f 0xd96e8 0x48cef 0x48f02 0x26d4a 0x18698 0x1befdf9 0x1befad0 0x1c09bf5 0x1c09962 0x1c3abb6 0x1c39f44 0x1c39e1b 0x1bee7e3 0x1bee668 0x15ffc 0x1e5d 0x1d85 0x1)
libc++abi.dylib: terminate called throwing an exception
(lldb) 

Penyebabnya adalah:
Saya pikir kesalahan ini saya tidak mendaftarkan nib atau sebuah class untuk sebuah identifier.

Sehingga saya dapat menyimpan apa yang saya lakukan di tableView: fungsi cellForRowAtIndexPath kemudian saya tambahkan kode ke viewDidLoad :

[self.tableView registerClass:[UITableViewCell class] forCellReuseIdentifier:@"Cell"];
Solusinya:
Saya pilih storyboard kemudian pilih Master View Controller 


Pastikan  identifier misalnya "MyBasicCell" seperti berikut ini:


harus sama nama identifiernya dengan yang ada di dequequeReusableCellWithIdentifier.



0 Response to "Objective C: Error Pada Bagian Thread 1 Program Received Signal SIGABRT"

Post a Comment