EXEC_BAD_ACCESS in UITableView cellForRowAtIndexPath

Posted by David van Dugteren on Stack Overflow See other posts from Stack Overflow or by David van Dugteren
Published on 2010-04-29T02:23:44Z Indexed on 2010/04/29 2:27 UTC
Read the original article Hit count: 406

My UITable is returning EXEC_BAD_ACCESS, but why!

See this code snippet!

Loading the UITableView works fine, so allXYZArray != nil and is populated!

Then scrolling the tableview to the bottom and back up causes it to crash, as it goes to reload the method cellForRowAtIndexPath

It fails on line: "NSLog(@"allXYZArray::count: %i", [allXYZArray count]);"

- (UITableViewCell *)tableView:(UITableView *)theTableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {

static NSString *CellIdentifier = @"CellIdentifier";

UITableViewCell *cell = [theTableView dequeueReusableCellWithIdentifier:CellIdentifier];

cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];

@try { if (allAdviceArray == nil) { NSLog(@"nil"); allXYZArray = [ToolBox getMergedSortedDictionaries:allXYZGiven SecondDictionary:allXYZSought]; } NSLog(@"%i", [indexPath row]); NSLog(@"allXYZArray::count: %i", [allXYZArray count]);

© Stack Overflow or respective owner

Related posts about exc-bad-access

Related posts about uitableview