UIActivityViewController iOS8 iPad Crash处理

来源:互联网 发布:php curl 文件大小 编辑:程序博客网 时间:2024/04/28 14:28

在iPhone 上程序一切正常,但独在iPad iOS8的系统上,UIActivityViewController会崩溃,经查阅资料:

On iPad the activity view controller will be displayed as a popover using the newUIPopoverPresentationController, it requires that you specify an anchor point for the presentation of the popover using one of the three following properties:

  • barButtonItem
  • sourceView
  • sourceRect

In order to specify the anchor point you will need to obtain a reference to the UIActivityController's UIPopoverPresentationController and set one of the properties as follows:

activityViewController.popoverPresentationController.sourceView = parentView;// 或者 activityViewController.popoverPresentationController.barButtonItem = _actionButton;// 或者SourceRect(不再举例)

资料地址:  http://stackoverflow.com/questions/25644054/uiactivityviewcontroller-crashing-on-ios8-ipads


0 0