tags:

views:

49

answers:

2

whats os the difference between initWithNibName and ViewDidLoad methods ? can i use them both?

+1  A: 

I think you may be confusing things here. nibNameOrNil is (usually) an argument name, frequently for -initWithNibName:bundle:. As such, it should be the name of your nib (.xib) file. -viewDidLoad is a method, and is called after your viewController has had it's view instantiated for the first time.

Ben Gottlieb
+3  A: 

initWithNibName - is what you call to create a view controller from specified nib file.

viewDidLoad - is what system calls on your controller after the controller’s view is loaded into memory. You can implement this method to perform some additional initialization (which is not done in nib file)

Vladimir
thanks. i can use the initWithNibName for sound implementation.
omri