Universal links. Attempting to load a view controller view while it is freed is not allowed for UIAlertController

I'm sure this is a structure error, but just to make sure someone else ran into this problem and found a solution?

When I click on the universal link and I open it, I get the following error in the console:

Attempting to load a view controller view while it is freed is not allowed and may result in undefined behavior ()

There is no UIAlertController at this point in the application - it is just a view controller that has a web view - that’s all.

Can someone help me or should I send a bug report?

Br chris

+6
source share
1 answer

I think this is just an iOS9 bug. I have the same problem, so I created a very simple project and tested w / iOS9 (iphone6 ​​+) and iOS10 (iphone7 +). In my case, the error message appeared in the UIDocumentInteractionController AND when I selected Apple apps (like email). The error message only appeared w / iOS9. So, I think this is just an iOS9 bug, and I'm just ignoring it. Here is the code.

import UIKit class ViewController: UIViewController { var documentInteractionController: UIDocumentInteractionController! = nil @IBAction func openDocInteraction(_ sender: Any) { if (documentInteractionController == nil) { documentInteractionController = UIDocumentInteractionController() } let pngfile = NSSearchPathForDirectoriesInDomains(.documentDirectory, .userDomainMask, true)[0] + "/testfile.png" documentInteractionController.url = URL(fileURLWithPath: pngfile) documentInteractionController.presentOptionsMenu(from: view.frame, in: view, animated: true) } override func viewDidLoad() { super.viewDidLoad() } } 
0
source

All Articles