我可以在不使用“未记录的 api”的情况下为 UnknownPersonViewController 创建自定义笔尖吗?

发布于 2024-11-17 18:18:08 字数 468 浏览 10 评论 0原文

我想向 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

丢了幸福的猪 2024-11-24 18:18:08

您无法提供替换 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文