1

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!

Wooble
90.5k12 gold badges111 silver badges132 bronze badges
asked Feb 18, 2011 at 14:06
2
  • Which compiler are you using ? gcc 4.0, 4.2, LLVM, other ? And what platform, Mac OS X or iOS ? Commented Feb 18, 2011 at 14:09
  • GCC 4.0 and I tried it on iOS Device and Simulator, but it makes no difference... I got also two warnings, you can find them under the following link Commented Feb 18, 2011 at 14:13

1 Answer 1

1

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.

answered Feb 18, 2011 at 14:22
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.