working iOS application
In order to
For display UIAlertController I need presentViewController
method of UIViewController class.
But UIAlertView is display from classes which are
UIView or NSObject
I can not get
[[[UIApplication sharedApplication] keyWindow].rootViewController presentViewController ...]
It looks like you are currently (pre-iOS8) triggering an alert view from within your view object. That's pretty bad practice, as in general alerts should be triggered from actions and logic. And that code should live in controllers.
I suggest you refactor your current code to move the logic that triggers the alert to the correct controller, and then you can easily upgrade to iOS 8 by using
self as the controller.
If instead you're calling the alert from an outside object, then pass in the controller to the method that calls the alert. Somewhere upstream you must have knowledge of the controller.