Xcode 无法将推送分配给视图中的按钮
我正在使用 xCode 4.2。我的大部分界面都在 mainstoryboard.xib 中。然而,列表详细信息正在使用其自己的 xib。这是一个基于选项卡式和导航的项目。在每个视图上,当按住 ctrl 键单击按钮时,“推送”选项可用,但在此详细视图.xib 上则不可用。因此我无法使按钮可点击并使其打开另一个视图。当我 ctrl Clcik 按钮时,我只看到退出时结束、触摸向下等。
有谁知道为什么会发生这种情况?这是因为它不在主故事板中吗?是否可以通过编程使其可点击?
I am using xCode 4.2. I have most of the interface in the mainstoryboard.xib. However a listing detail is using its own xib. It is a tabbed and navigation based project. On every view when a ctrl click a button "Push" option is available however on this detail view.xib its not. And hence I cannot make the button clcikable and make it open another view. I only see Did End on Exit, touch Down, etc. when I ctrl Clcik the button.
Anyone know why this happens? is this because it is not in the mainstoryboard? is it possible to make it clickable programmatically?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果由于某种原因您无法将其包含在情节提要中,那么您将必须在代码中加载并推送它。这是非常标准的代码 - 使用
initWithNibName:
创建视图控制器的新实例,向其传递任何详细变量,然后告诉导航控制器推送新控制器。此代码必须链接到保存按钮的视图控制器中的操作。If you can't include it in the storyboard for some reason then you will have to load and push it in code. This is pretty standard code - create a new instance of the view controller using
initWithNibName:
, pass it any detail variables, then tell your navigation controller to push the new controller. This code will have to be linked to an action in the view controller that holds the button.