EXEC_BAD_ACCESS in a UITableView cellForRowAtIndexPath

My UITableView returns EXEC_BAD_ACCESS, but why!

See this piece of code!

Loading UITableView works great, so allXYZArray != nilit fills up!

Then scrolling down the table view from the bottom and backing up causes it to fail, as it overloads the cellForRowAtIndexPath method

He does not work:

    "NSLog(@"allXYZArray::count: %i", [allXYZArray count]);"

        (UITableViewCell *)tableView:(UITableView *)theTableView cellForRowAt

IndexPath:(NSIndexPath *)indexPath { 

static NSString *CellIdentifier = @"CellIdentifier";
UITableViewCell *cell = [theTableView dequeueReusableCellWithIdentifier:CellIdentifier];


cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
@try
{ 
if (allXYZArray == nil) {
   NSLog(@"nil");
   allXYZArray = [ToolBox getMergedSortedDictionaries:allXYZGiven SecondDictionary:allXYZSought];
}
NSLog(@"%i", [indexPath row]);
NSLog(@"allXYZArray::count: %i", [allXYZArray count]);
+5
source share
2 answers

EXC_BAD_ACCESS , , . , . , EXC_BAD_ACCESS , , . , NSZombieEnabled - , .

, , [allXYZArray count], allXYZArray . +[ToolBox getMergedSortedDictionaries:SecondDictionary:], , , . , , , , Cocoa. (, SDK. , .)

+10

, , :

UITableViewCell *cell = [theTableView dequeueReusableCellWithIdentifier:CellIdentifier];

( , ).

, , .

if (cell == nil)
   cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
+1

All Articles