简体   繁体   English

ABPeoplePickerNavigationController慢吗?

[英]Is ABPeoplePickerNavigationController slow?

When using ABPeoplePickerNavigationController it takes a moment (~0.5 sec) to load and display the control which is slower than the normal reaction time of other popups. 使用ABPeoplePickerNavigationController ,要花一点时间( ABPeoplePickerNavigationController秒)来加载和显示控件,该控件的速度比其他弹出窗口的正常反应时间慢。

I came with the solution set the controller as a variable and access this pre-loaded object via: 我提供的解决方案是将控制器设置为变量,并通过以下方式访问此预加载的对象:

[self presentViewController:self.peoplePicker animated:YES completion:nil];

Just out of curiosity, is there another way to fire up the picker without preloading it? 只是出于好奇,还有另一种方法可以在不预加载的情况下启动选择器吗?

Same here, I don't have the answer to solve it and I think that it could be an iOS 8 bug ( UPDATE : yes it its, Apple confirmed it). 同样在这里,我没有答案来解决它,我认为这可能是iOS 8的错误( 更新 :是的,Apple确认了)。

In my tests on iOS 7.x the ABPeoplePicker presentation time is less than 0.2 sec. 在我对iOS 7.x的测试中, ABPeoplePicker的演示时间少于0.2秒。

The problem appears only on iOS 8.x, and only the first time that you present the ABPeoplePicker . 该问题仅在iOS 8.x上出现,并且仅在您首次出现ABPeoplePicker时出现 The ABPeoplePicker presentation takes about 3 sec in my application and about 1,5 sec in a sample application that do only the ABPeoplePicker presentation by pressing a button. 在我的应用程序中, ABPeoplePicker演示文稿大约需要3秒钟,而在示例应用程序中,通过按一个按钮仅执行ABPeoplePicker演示文稿,大约需要1.5秒。 I tested it both on simulator and device with ~20 contacts. 我在模拟器和具有约20个触点的设备上进行了测试。

Pre-loading the instance doesn't change significantly the presentation time just as I expected. 预加载实例不会像我期望的那样显着改变演示时间。 I've also tried to force the presentation on the main thread and to set animation to NO, but it's still slow on iOS 8. 我也尝试过强制在主线程上进行演示,并将动画设置为NO,但是在iOS 8上仍然很慢。

The time profiler doesn't help me because I can't see an unexpected long time of computation. 时间分析器对我没有帮助,因为我看不到意外的长时间计算。

While we wait for the supposed bug fix, I think that the best workarounds are to show an activity progress indicator while loading the ABPeoplePicker or to implement our own ABPeoplePicker . 当我们等待所谓的错误修复时,我认为最好的解决方法是在加载ABPeoplePicker时显示活动进度指示器或实现我们自己的ABPeoplePicker

I've implemented my own, you can find it on GitHub: VeeContactPicker , and of course use it! 我已经实现了自己的应用程序,您可以在GitHub上找到它: VeeContactPicker ,当然可以使用它! 😉 😉

NEWS FROM APPLE: 苹果新闻:

Apple team answered to my bug report: 苹果团队回答了我的错误报告:

Apple Developer Relations 16-Jun-2015 00:36 AM Apple Developer Relations 2015年6月16日上午00:36

We believe this issue has been addressed in the latest iOS 9 beta. 我们认为此问题已在最新的iOS 9 beta中得到解决。 This is a pre-release iOS 9 update. 这是iOS 9的预发布更新。 Please refer to the release notes for complete installation instructions. 请参阅发行说明以获取完整的安装说明。 Please test with this release. 请对此版本进行测试。 If you still have issues, please provide any relevant logs or information that could help us investigate.* 如果仍有问题,请提供任何相关日志或信息,以帮助我们进行调查。*

iOS 9 update iOS 9更新

In iOS 9 the ABFramework has been deprecated for a new object-oriented contacts framework that comes with a new picker [see CNContactPicker ]! 在iOS 9中,ABFramework已被弃用,因为它带有一个新的面向对象的联系人框架,并带有一个新的选择器[请参见CNContactPicker ]! Unfortunately it seems that the issue hasn't been resolved, the logic has been updated but the ViewController is still the same one as of iOS 8. So the CNContactPicker is still very slow to load and display the control... 不幸的是,问题似乎尚未解决,逻辑已更新,但ViewController与iOS 8相同。因此CNContactPicker加载和显示控件的速度仍然很慢...

I've reported the bug to Apple, waiting for news... 我已将该错误报告给了苹果,等待消息...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM