initWithNibName VS NSBundle's loadNibNamed

Viewed 4183

I've noticed that there are two different ways to load nib/xib files:

  1. via the UIView's initWithNibName:bundle: method
  2. NSBundle's loadNibNamed:owner:options: method.

Can someone explain the differences between these two and when it is more appropriate to use one over the other and in what circumstances?

For instance, if I'm loading a custom table section header view from a nib file in the tableView:viewForHeaderInSection: method, which one would I use?

Or, if I were loading a custom table view cell from a nib file, which one would I use?

2 Answers
Related