hi everyone, I am facing some issues with running an app on my device. It is a game that requires the player to click on a “Hit Me” button. However, an error pops up in the print section:
Hi @flora_land,
The error that you mentioned is the most common error that developers come across, in fact if you mention portions of the message, it is evidently clear on the problem.
Here’s what happens, self.presentViewController(newVC ... generally means present the newVC in the hierarchy so that when you dismiss the viewController, it should revert back to the one you called from. In your case, you are presenting UIAlertController on bulls_eye and I believe you are trying this in viewDidLoad or before the bulls_eye viewController is displayed and part of the view hierarchy.
There are a couple of ways to manage that, one is to display the alert in a delay loop after 2-5 seconds by which the VC would have been part of the view hierarchy.
The other is to use the rootViewController as the parent of the alert than using self.