PDA

View Full Version : view init in iphone OS




bkphat
Jun 19, 2008, 01:58 AM
What method is called once a view is displayed fully?
Specifically, I have added a subview to a superview. Only when this subview is fully visible on screen (which may take a while due to content) do I want to execute this function. I tried didMoveSuperview and didMoveToWindow, but both are called before the view is displayed to the user.

thanks

bk



Sbrocket
Jun 19, 2008, 03:59 AM
viewDidAppear: is sent to the view controller. I haven't used it before, but that should be what you want.

white89gt
Jun 19, 2008, 08:02 AM
viewDidLoad: is called right after the view loads, and is usually only called once. The viewWillAppear or viewDidAppear methods are called every time that particular view appears on screen, so they could be called multiple times depending on how much switching back and forth between views you do.