将另一个 UIViewController 的视图放入“主”视图中UIViewController——委托方法
我正在尝试制作一个与 iPhone 上的 iCal 应用程序非常相似的应用程序。
为此,我集成了 2 个开源项目:Kal (https://github.com/klazuka/Kal) 和 GuiCocoa/Calendar (https://github.com/guicocoa/calendar),以及我自己的项目编码的“列表”视图段。
我决定,因为我需要将所有内容嵌套在 UINavigationController 堆栈中,所以将这 3 个独立项目实现为一种事物的最佳方法是,我将创建类似于 UITabBarController 的东西(其中您有 1 个 UIViewController 类,它存储和嵌套其他UIViewControllers——但是,我想使用带有 UISegmentedControl 的自定义 UIToolbar 来在不同的视图控制器之间进行委托。
所以我遇到的最重要的问题是行动的错误授权。例如:
如果我单击其中一个网格日期,它会返回错误:
-[UINavigationButton didSelectDate:]:无法识别的选择器发送到实例 0x6c1aba0
或类似的内容。
也许我的问题应该是:是否有 UITabBarController 的“子类”,我可以实现自己的 UIToolbar,而不是官方的 UITabBar 等?
或者如果没有,是否有一种方法可以指定“子视图”中的所有点击都将委托给子视图中的函数?
谢谢, rnc505
I'm trying to make an application very similar to the iCal app on the iPhone.
To do this, I'm integrating 2 open source projects, Kal (https://github.com/klazuka/Kal) and GuiCocoa/Calendar (https://github.com/guicocoa/calendar), as well as my own coded "List" view segment.
I decided, since I need everything nested in a UINavigationController Stack, that the best way to achieve this 3 separate projects into one kind of thing, I would create something similar to the UITabBarController (in which you have 1 UIViewController Class which stores and nests other UIViewControllers -- HOWEVER, I want to use a custom UIToolbar with a UISegmentedControl to delegate between the different view controllers).
So the most major issue I am running into is the mis-delegation of actions. For example:
If I were to click one of the gridded dates, it kicks back the error:
-[UINavigationButton didSelectDate:]: unrecognized selector sent to instance 0x6c1aba0
or something similar.
Maybe my question should be: Is there a "subclass" of UITabBarController which I can implement my own UIToolbar, instead of the official UITabBar, etc?
Or if not, is there a way to specify that all clicks in the "subview" are to be delegated to functions from within the subview?
Thanks,
rnc505
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
首先,您可以子类化 UIToolBar 来自定义它。
而不是调用:
您调用
您的另一个选择是根据需要更改按钮的委托。
First off you can subclass a UIToolBar to customize it.
and instead of calling:
you call
Your other option is to just change the delegate of the buttons as needed.