views:

64

answers:

1

I ran across this segment of code (in .m implementation file in an IBAction instance method):

UIActionSheet *actionSheet = [[UIActionSheet alloc] ...];
...
[actionSheet showInView:self.view];

self refers to the button but I wanted to know where I could find out about this "view" property since I looked up UIButton, UIView, NSObject, but could not find out where this "view" property came from.

(also, any corrections on terminology would be appreciated since I am trying to learn all the correct terms - I'm a beginner iPhone programmer)

+3  A: 

The view property is one of a UIViewController. The controller usually creates a view in its initialization, and is responsible for managing it. Any subclass of UIViewController will inherit this property. See this link for more details. Also, you may want to familiarize yourself with MVC(model view controller), as this might make it more clear why the controller has a view property. See this link for more details.

Mike
how would I use viewDidLoad?
Devoted
In your UIViewController subclass, simply add the method:- (void)viewDidLoadInside of it, you can put whatever you want to happen when your view finishes loading into memory.
Mike
+1 for quick useful answer!
Devoted