私はカスタムセル(ウェブサイトから生成されたuiimageを含む)を持つUITableViewを持っています。そして、行を選択すると詳細ビューになります。ビューが読み込まれるとすぐに行をクリックすると、アプリがクラッシュすることがあります。ときどき私が詳細ビューからメインのテーブルビューに戻ると、アプリケーションがクラッシュすることがあります。私はコードを貼り付けるつもりはありません。なぜなら私が正直に何を投稿する必要があるのかわからないからです。無作為にクラッシュする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;
}
のNSLogレポートは
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[CALayerArray bannerView:didFailToReceiveAdWithError:]: unrecognized selector sent to instance 0x1bcd70'
didFailToReceiveAdWithError
方法は
- (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;
}
}
未満であると言います
クラッシュ時にNSLogが言っていること – iPrabu
少なくとも、あなたの実装を 'tableView:cellForRowAtIndexPath:'に投稿する必要があると思います。 –
私はあなたがデバッグビルドをしているとします。そのため、アプリがクラッシュしたときにコンソールにはどのようなエラーが報告されますか? –