UIActivityViewController warning/errors

This is a simple test file sharing which I cannot find info on. the "(This will become a fault soon.)" from xcode is what is the worrisome, it seems to have developed recently with xcode update?

I don't want to release an app which may soon fail.

class ShareFile_ViewController: UIViewController {

    override func viewDidLoad() {      

   super.viewDidLoad()

           

navigationItem.rightBarButtonItem = UIBarButtonItem(title: "Share", style: .plain, target: self, action: #selector(shareFile))

        }       

 @objc func shareFile() {

           

 if let fileURL = Bundle.main.url(forResource: "Skiing", withExtension: "gpx") {
     let ac = UIActivityViewController(activityItems:        [fileURL], applicationActivities: nil)
     present(ac, animated: true, completion: nil)

            }       

} }

// this error has been beat to death as don't worry about it.

2022-02-19 16:28:47.644274-0800 ShareFile_Learn[36671:12674168] [db] Failed to initialize client context with error Error Domain=NSOSStatusErrorDomain Code=-54 "process may not map database" UserInfo={NSDebugDescription=process may not map database, _LSLine=264, _LSFunction=-[_LSDReadClient getServerStoreWithCompletionHandler:]}

// this warning is my concern since it says it become a fault soon, should I worry about this?

2022-02-19 16:28:47.644370-0800 ShareFile_Learn[36671:12674168] [default] -imageForImageDescriptor: can do IO please adopt -imageForDescriptor: for IO free drawing or -prepareImageForDescriptor: if IO is allowed. (This will become a fault soon.)

Replies

Could you tell where exactly in code you get those warnings ?

The shareFile() function is where the warning occurs.

let ac = UIActivityViewController(activityItems: [fileURL], applicationActivities: nil) present(ac, animated: true, completion: nil)

Scouring the internet for other code resources for UIActivityViewController all return the same warning.

this is on an iPhoneXR 15.1 xcode 13.2.1

  • Could you show how fileURL is exactly defined ?

  • The call works(for now) and I can airdrop etc. to another device, but warning are persistent.

    import UIKit

    class ShareFile_ViewController: UIViewController {

        @IBAction func share(_ sender: Any) {         shareFile()     }

        override func viewDidLoad() {             super.viewDidLoad()         }

        func shareFile() {

            let url = Bundle.main.url(forResource: "Skiing", withExtension: "gpx")

            let activityViewController = UIActivityViewController(activityItems: [url as Any], applicationActivities: nil)        activityViewController.completionWithItemsHandler = {(activityType: UIActivity.ActivityType?, completed: Bool, returnedItems: [Any]?, error: Error?) in

                   if !completed {                    print("not completed")                    return                }                    print("completed")            }           present(activityViewController, animated: true) //{() -> Void in }        } }

    If I try to share a string it returns the same warning.

    let items = ["This app is my favorite"]  let ac = UIActivityViewController(activityItems: items, applicationActivities: nil)  present(ac, animated: true)

    Researching on Internet has some calling it a bug, but I'm not sure if it is.

    Thanks

    Also, how do I format these posts when pasted from Xcode to look presentable?

Add a Comment