XIB auto loading for UITableViewController

Go into something interesting, want to know that I'm doing something wrong or if this is the right behavior.

I have a custom UITableViewController. I ACCEPT (the first error) that if you initialize as such:

[[CustomTableController alloc] init];

it will be automatically loaded from the same XIB name, CustomTableController.xib if it is in the same directory, etc.

HOWEVER

This does not work; does not load XIB. BUT, if I change the parent class of my controller from "UITableViewController" to "UIViewController", EVERYHTING WORKS FINE!

Vocation:

[[CustomTableController alloc] init];

downloads the controller and views it from my xib.

Am I doing something wrong? This is mistake? Expected Behavior?

+5
1

Cocoa " ", init, . , , . , - ( , - [NSObject init] ), , . . .

UIViewController , - initWithNibName:bundle:. nil nibName, , . -init UIViewController. , , , [self initWithNibName:nil bundle:nil], initWithNibName:bundle:, .

UITableViewController -initWithStyle: ( ). UITableViewController , . subviews UITableView, , UITableViewController .

, UITableViewController , , -initWithStyle: UIViewController initWithNibName:bundle:. , UITableView :

  • nib initWithNibName:bundle: ( UIViewController), UITableViewController , nib. UITableView . tableView.

  • nib, , , , nib ( ). nib nib , UITableViewController self.

, Cocoa Touch , , . , , .

+26

All Articles