从UIBarButtonItem创建nib视图? [英] Creating nib view from UIBarButtonItem?

查看:82
本文介绍了从UIBarButtonItem创建nib视图?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我之前看过类似的问题,但他们没有任何帮助。我也读过Apple的文档,但我无法理解我哪里出错了。 AFAIK我在逻辑上做了所有事情,但是当我点击 UIToolbar 叠加上的完成按钮时,按钮可以被按下但是它什么也没做。这显然意味着它无法确认书面代码。但是如何?

So I've seen previous questions similar to this but they were of no help. I've read Apple's documentation too but I could not understand where I've gone wrong. AFAIK I did everything logically, but when I click on my done button on an UIToolbar overlay, the button can be pushed but it does not do anything. This obviously means it fails to acknowledge the written code. But how?

我想在 UIToolbar 。但下面不允许点击显示新视图。我该如何纠正这个?请告诉我哪里出错了,应该更换什么以及为什么。

I want to bring up the .nib of "TableViewController" when a done button is clicked on my UIToolbar. But the below isn't allowing the click to bring up a new view. How do I rectify this? Please show me where I went wrong and what should be replaced and why.

//Here's the selector:
UIBarButtonItem *doneButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:
    UIBarButtonSystemItemDone target:self  action:@selector(doneButtonPressed)];

以下是我采取行动的方式。

Here's how I made my action.

-(void)doneButtonPressed {
    TableViewController *tableView = [[TableViewController alloc]
        initWithNibName:@"TableViewController" bundle:nil];
    tableView.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
    [self presentModalViewController:tableView animated:YES];
}

// Yet nothing happens when I click on my done button on my overlay. The button
// can be clicked, but nothing happens. Please shed any insight pleasee!


推荐答案

您是否将UIToolbar创建为nib文件?

Did you create the UIToolbar into a nib file?

这篇关于从UIBarButtonItem创建nib视图?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆