1

私は iOS システム用の地図ナビゲーション アプリケーションに取り組んでいます。現在、マップを OpenGL ES 2.0 ビューにロードしているため、スクロールなどが可能です。マップ上に、目的地を選択するために UITableView に移動する UIButton を配置しました。コードは以下のとおりです。

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];

これにより、次のメソッドがトリガーされます。

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

しかし、XIBのロードに失敗し、ボタンを押すと「プログラムが信号SIGABRTを受信しました」というエラーで終了します。

また、OpenGL マップ ビューはタブ付きビューに基づいており、いくつかのオプションの 1 つです。OpenGL マップ ビューの初期化コードは次のとおりです。

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

OpenGL の EAGLView をテーブル ベースのビューに正しく交換するにはどうすればよいですか?

4

0 に答える 0