Ich habe eine UITableView mit einer benutzerdefinierten Zelle, (enthält ein uiimage von einer Website generiert) und wenn ich eine Zeile auswähle, bringt es mich zu einer Detailansicht. Wenn ich jetzt auf eine Zeile klicke, sobald die Ansicht geladen wird, stürzt die App manchmal ab. Manchmal, wenn ich aus der Detailansicht zur Hauptansicht der Tabelle zurückkehre, stürzt die App ab. Ich werde meinen Code noch nicht einfügen, da ich ehrlich gesagt keine Ahnung habe, was ich überhaupt posten müsste.Zufällig abstürzt UITableView
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
int storyIndex = [indexPath indexAtPosition: [indexPath length] - 1];
selectedItems = [[stories objectAtIndex: storyIndex] objectForKey: @"title"];
DetailViewController *dvController = [[DetailViewController alloc] initWithNibName:@"DetailView" bundle:[NSBundle mainBundle]];
dvController.imageArray = images;
dvController.selectedItems = selectedItems;
dvController.indexpath = storyIndex;
[self.navigationController pushViewController:dvController animated:YES];
[dvController release];
dvController = nil;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *CellIdentifier = @"Cell";
CustomCell *cell = (CustomCell *)[tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
[[NSBundle mainBundle] loadNibNamed:@"CustomCell"owner:self options:nil];
cell = customCell;
self.customCell = nil;
}
// Configure the cell.
int storyIndex = [indexPath indexAtPosition: [indexPath length] - 1];
cell.title.text = [[stories objectAtIndex: storyIndex] objectForKey: @"title"];
[cell.webview loadHTMLString:[NSString stringWithFormat:@"<html><body>%@</body></html>", [images objectAtIndex:indexPath.row]] baseURL:nil];
//NSLog(@"%@", [images objectAtIndex:indexPath.row]);
return cell;
}
Der NSLog Bericht sagt
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[CALayerArray bannerView:didFailToReceiveAdWithError:]: unrecognized selector sent to instance 0x1bcd70'
Die didFailToReceiveAdWithError
Methode unter
- (void)bannerView:(ADBannerView *)banner didFailToReceiveAdWithError:(NSError *)error
{
if (self.bannerIsVisible)
{
[UIView beginAnimations:@"animateAdBannerOff" context:NULL];
// banner is visible and we move it out of the screen, due to connection issue
banner.frame = CGRectOffset(banner.frame, 0, -50);
[UIView commitAnimations];
self.bannerIsVisible = NO;
}
}
Was Ihr NSLog beim Absturz sagt – iPrabu
Ich denke, dass Sie Ihre Implementierung von 'tableView: cellForRowAtIndexPath:' mindestens veröffentlichen müssen. –
Ich nehme an, dass Sie einen Debug-Build erstellen. Wie wird der Fehler in der Konsole gemeldet, wenn die App abstürzt? –