My situation with this is different than every other example I have been able to find on here. I have a tab based app. On one of the tabs a user is able to press a button that downloads several files from a web server all at once.
I make use of NSOperation to perform each of these downloads so that I can utilize the built in dependencies. The downloads are all occurring on a background thread so the app remains responsive. When the final download is complete I put an alertController on screen letting the user know that they are complete.
If the user has selected a different tab when the alert controller is presented I get the warning: "Presenting view controllers on detached view controllers is discouraged"
If they are still on the same tab that started the downloads then I don't get the warning. I tried replacing:
[self presentViewController:alertController animated:YES completion:nil];
[self.view.window.rootViewController presentViewController:alertController animated:YES completion:nil];
You need to delegate the result of the download to the top-level view controller, which sounds like your
UITabBarController certainly knows which tab is selected, or it can present the alert on itself.