Note that there are some explanatory texts on larger screens.

plurals
  1. POUITableView crashes when scroll down
    primarykey
    data
    text
    <p>I know there's a lot of questions about this topic but I have not be able to solve my problem...</p> <p>Well, I have detected the problem, it's the contactsArray that's global. If I comment that lines, the table works fine.</p> <p>The code is this:</p> <pre><code>@interface ContactsView : UIViewController &lt;UITableViewDelegate, UITableViewDataSource&gt;{ IBOutlet UITableView *table; NSMutableArray * contactsArray; } @property (nonatomic, retain) NSMutableArray *contactsArray; @property (nonatomic, retain) IBOutlet UITableView *table; </code></pre> <p>In viewDidLoad I do:</p> <pre><code>contactsArray = [[NSMutableArray alloc] init]; </code></pre> <p>And here the implementation of each cell:</p> <pre><code>- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @"ContactsCell"; ContactsCell *cell = (ContactsCell *) [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; if(cell==nil){ NSArray *topLevelObjects = [[NSBundle mainBundle] loadNibNamed:@"ContactsCell" owner:self options:nil]; for(id currentObject in topLevelObjects){ if([currentObject isKindOfClass:[UITableViewCell class]]){ cell = (ContactsCell *) currentObject; break; } } } // Configure the cell... Person *persona = [[Person alloc] init]; persona=[contactsArray objectAtIndex:indexPath.row]; [cell setCellNames:[persona name]]; [cell setCellStates:@"En Donosti"]; [persona release]; return cell; } </code></pre> <p>If I comment the <code>persona=[contactsArray objectAtIndex:indexPath.row];</code> and <code>[cell setCellNames:[persona name]];</code> So, I'm pretty sure that the problem is with contactsArray</p> <p>Any idea why is it crashing?</p> <p>Thanks!</p>
    singulars
    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.
    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