Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

patrover

macrumors newbie
Original poster
Aug 15, 2009
25
0
let's say AViewController pushes BViewController,
now i call bViewController.parentViewController, i'm expecting to get aViewController but i get a navigationController instead..

can anyone explain? thanks
 
From the documentation on parentViewController:
Parent view controllers are relevant in navigation, tab bar, and modal view controller hierarchies. In each of these hierarchies, the parent is the object responsible for displaying the current view controller.
Since you're using a navigation view controller hierarchy, the navigation controller is the one responsible.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.