You must do this in viewWillAppear :, or viewDidAppear: if the first does not work. trying to do this in viewDidLoad will not work, because it is called after the view is first created, and the view is not an approach to anything else at this point. As far as I understand, to call currentModalViewController on itself, the view should be displayed at some level in UIWindow.
One more thing I just noticed; your code skips memory depending on how you declare your imgPicker property. if it is declared with preservation instead of assignment, then unless you explicitly release it twice somewhere, this collector will always exist in memory. You must auto-detect the init'd object when you assign it in this case.
source share