Ios4 随机崩溃UITableView

Ios4 随机崩溃UITableView,ios4,uitableview,Ios4,Uitableview,我有一个带有自定义单元格的UITableView(包括从网站生成的uiimage),当我选择一行时,它会将我带到详细视图。现在,如果我在视图加载后立即单击一行,有时应用程序会崩溃。有时,当我从详细视图返回主表视图时,应用程序将崩溃。我还不打算粘贴我的代码,因为我真的不知道我需要发布什么 - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { int storyInd

我有一个带有自定义单元格的UITableView(包括从网站生成的uiimage),当我选择一行时,它会将我带到详细视图。现在,如果我在视图加载后立即单击一行,有时应用程序会崩溃。有时,当我从详细视图返回主表视图时,应用程序将崩溃。我还不打算粘贴我的代码,因为我真的不知道我需要发布什么

- (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;
}

didfailetoreceiveawitherror
方法如下所示

    - (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;
    }
}

你得到的错误

Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[CALayerArray bannerView:didFailToReceiveAdWithError:]: unrecognized selector sent to instance 0x1bcd70'

…相当清楚。这与UITableView无关,与您尚未在ADBannerViewDelegate中实现该方法有关

当crashingI认为您至少需要发布
tableView:cellForRowAtIndexPath:
的实现时,您的NSLog会说些什么。我猜您正在进行调试构建。因此,当应用程序崩溃时,控制台会报告什么错误?有人吗?我会给一个+1!!!!!我确实把它放在那里了,但它仍然会出错。我在上面添加了代码。这就是错误的意思。您是否应该在正确的委托类中具有精确的方法签名?
    - (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;
    }
}
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[CALayerArray bannerView:didFailToReceiveAdWithError:]: unrecognized selector sent to instance 0x1bcd70'