我可以在不使用“未记录的 api”的情况下为 UnknownPersonViewController 创建自定义笔尖吗?
我想向 ABUnknownPersonView 添加一些自定义按钮。我可以在 ABUnknownPersonViewController 中使用 initWithNibName:bundle:
来加载我在 IB 中创建的自定义视图,而不使用“未记录的 api”吗?如果我这样做,我如何确保它遵循所有属性并响应控制器期望的所有挂钩?
我通常以编程方式创建所有视图,并且通常喜欢 ABUnknownPersonViewController 创建的视图。我宁愿从那里开始。因此,我访问了该视图并放入了一个按钮,但是随着 iOS 的更高版本的出现,该按钮被破坏了,因为这不是 Apple 创建的钩子。
ABUnknownPersonViewController
文档中也未提及 initWithNibName
,但它是其父类 UIViewController
的一个方法。这使它可以安全使用吗?
I'd like to add some custom buttons to an ABUnknownPersonView. Can I use initWithNibName:bundle:
in my ABUnknownPersonViewController to load a custom view that I've created in IB, while not using an "undocumented api?" And if I do, how can I make sure that it follows all the properties and responds to all the hooks that the controller expects?
I typically create all my views programmatically and I generally like the view that ABUnknownPersonViewController
creates. I'd rather just start from there. And so I accessed the view and dropped in a button, but with later versions of iOS that broke since that isn't a hook that Apple created.
initWithNibName
is also not mentioned in the ABUnknownPersonViewController
documentation but it is a method of it's parent class UIViewController
. Does that make it safe to use?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您无法提供替换 XIB。虽然我知道您想避免它,但您必须使用底层
AddressBook
框架并从中构建您自己的版本。当然,您可以查看开源内容,例如
this
良好的起点。You cannot provide a replacement XIB. While I understand you want to avoid it, you will have to use the underlying
AddressBook
framework and building your own version out of it.You can, of course, look at open source stuff such as
this
for a good starting point.