1

I am working on a map navigation application for the iOS system. I currently have the map loaded in an OpenGL ES 2.0 view, which allows me to scroll etc. On the map I have placed a UIButton which should take me to a UITableView to select a destination; the code is below:

UIButton *aButton = [UIButton buttonWithType:UIButtonTypeCustom];
[aButton setBackgroundImage:[UIImage imageNamed:@"buttonImage.png"] forState:UIControlStateNormal];
aButton.frame = CGRectMake(15, 15, 55, 55);
[self.view addSubview:aButton];  
[aButton addTarget:self action:@selector(switchViews) forControlEvents:UIControlEventTouchUpInside];

This triggers this method:

UITableViewController* optionsController = [[UITableViewController alloc] initWithNibName:@"selectOptions" bundle:[NSBundle mainBundle]];
[self.view addSubview:optionsController.view];

But it fails to load the XIB, it just quits on the button press with the "program received signal SIGABRT" error.

Also the OpenGL map view is based within a tabbed view, it is one of several options; here is the init code of the OpenGL map view:

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        self.title = NSLocalizedString(@"mapView", @"mapView");
        self.tabBarItem.image = [UIImage imageNamed:@"mapViewImage"];
    }
    return self;
}

How do I go about swapping out an EAGLView for OpenGL with a Table based view correctly?

Paul Reed
  • 113
  • 14

0 Answers0