开发者

Bar Button on navigation based app

I want to add a Bar button to the Navigation bar on a Navigation based app, the bar however is on the MainWindow and has no code behind开发者_开发问答 so I Can't connect it to an IBAction.

how do i go about connecting it to an action ?


You can add the button to the navigation bar programmatically like this and also connect it up to an action with the init code:

    UIBarButtonItem* button = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:<UIBarButtonStyle that you want> target:self action:@selector(<some_action>:)];
    self.navigationItem.rightBarButtonItem = button;
    [button release];
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜