EXEC_BAD_ACCESS in UITableView cellForRowAtIndexPath
- by David van Dugteren
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]);