Note that there are some explanatory texts on larger screens.

plurals
  1. PODisplay multiple row types in an UITableView
    primarykey
    data
    text
    <p>I've been trying to create an UITableView that display multiple rows (more specific 2, for now),the thing is, I need to load those 2 custom cells from XIB files. I've already created two UITableViewCell's, but when try to make it work the app just crashes (SIGARBRT), I can only suppose that is a mistake in the code below:</p> <pre><code>- (UITableViewCell *)tableView:(UITableView *)atableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{ static NSString *CellIdentifier1 = @"ACell"; ACell *cell1 = (ACell *)[userSettingsTableView dequeueReusableCellWithIdentifier:CellIdentifier1]; static NSString *CellIdentifier2 = @"BCe;;"; BCell *cell2 = (BCell *)[userSettingsTableView dequeueReusableCellWithIdentifier:CellIdentifier2]; if([indexPath row] == 0) return cell1; if([indexPath row] == 1) return cell2; return nil; return cell1; } </code></pre> <p>Error Message:</p> <pre><code>2012-05-05 18:21:49.256 StrangeThings[4388:f803] *** Assertion failure in -[UITableView _createPreparedCellForGlobalRow:withIndexPath:], /SourceCache/UIKit_Sim/UIKit-1914.84/UITableView.m:6061 2012-05-05 18:21:49.258 StrangeThings[4388:f803] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'UITableView dataSource must return a cell from tableView:cellForRowAtIndexPath:' *** First throw call stack: (0x13cf022 0x1560cd6 0x1377a48 0x9b02cb 0xb3d28 0xb43ce 0x9fcbd 0xae6f1 0x57d42 0x13d0e42 0x1d87679 0x1d91579 0x1d164f7 0x1d183f6 0x1da5160 0x29f30 0x13a399e 0x133a640 0x13064c6 0x1305d84 0x1305c9b 0x12b87d8 0x12b888a 0x19626 0x1af2 0x1a65 0x1) terminate called throwing an exception(lldb) </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload