Internal compiler error: Bus error

Im trying to make a UITableView with a View with Details but I get two errors. After the following code I got two times the same errors: 'Internal compiler error: Bus error' and I have no idea why? Can someone help me? You can find a image of the code under here.

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {

NSInteger row = [indexPath row];
if (self.verwaltungDetailViewController == nil){
    verwaltungDetailViewController *aVerwaltungDetail = [[verwaltungDetailViewController alloc] initWithNibName:@"VerwaltungDetailView" bundle:nil];
    self.verwaltungDetailViewController = aVerwaltungDetail;
    [aVerwaltungDetail release];

}
verwaltungDetailViewController.title =  [NSString stringWithFormat:@"%@", [verwaltungsArray objectAtIndex:row]];



NatersAppDelegate *delegate = [[UIApplication sharedApplication] delegate];
[delegate.VerwaltungNavController pushViewController:verwaltungDetailViewController animated:YES];

}

Thanks a lot in advance for your help!


It looks to me like you've got a class somewhere called VerwaltungDetailViewController (note the uppercase 'V') and you are mixing it up with an instance variable & property called verwaltungDetailViewController (note the lowercase 'v'). In the first line of the if block, you are attempting to create an instance of the latter, when you should be attempting to create an instance of the former. Your code should look something like this:

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {

NSInteger row = [indexPath row];
if (self.verwaltungDetailViewController == nil){
    VerwaltungDetailViewController *aVerwaltungDetail = [[verwaltungDetailViewController alloc] initWithNibName:@"VerwaltungDetailView" bundle:nil];
    self.verwaltungDetailViewController = aVerwaltungDetail;
    [aVerwaltungDetail release];

}
verwaltungDetailViewController.title =  [NSString stringWithFormat:@"%@", [verwaltungsArray objectAtIndex:row]];



NatersAppDelegate *delegate = [[UIApplication sharedApplication] delegate];
[delegate.verwaltungNavController pushViewController:verwaltungDetailViewController animated:YES];

Edit: You also make the mistake in the last line of code, except in reverse.

链接地址: http://www.djcxy.com/p/35366.html

上一篇: 内部编译器错误:总线错误

下一篇: 内部编译器错误:总线错误