Я пытаюсь вставить пользовательский UITableViewController в представление контейнера. Container View размещается внутри ячейки статического UITableView, как показано на рисунке ниже.
http://i.stack.imgur.com/A762B.png
Мне просто нужен метод объединения статических и динамических ячеек на одном экране.
В Identity Inspector, когда поле Class пусто (т. е. стандартный UITableViewController), он работает, показывая пустую динамическую таблицу внутри ячейки. Но когда я помещаю в это поле имя собственного класса (расширяющее UITableViewController), я получаю исключение NSInternalInconsistencyException:
[UITableViewController loadView] loaded the "Enx-aT-Rum-view-zY2-9U-Z6d" nib but didn't get a UITableView.
Это содержимое MyCustomUITableViewController:
@implementation MyCustomUITableViewController
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
// Custom initialization
}
return self;
}
- (void)viewDidLoad
{
[super viewDidLoad];
// Uncomment the following line to preserve selection between presentations.
// self.clearsSelectionOnViewWillAppear = NO;
// Uncomment the following line to display an Edit button in the navigation bar for this view controller.
// self.navigationItem.rightBarButtonItem = self.editButtonItem;
}
- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
#pragma mark - Table view data source
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
// Return the number of sections.
return 1;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
return 2;
}
@end
Я должен признать, что я до сих пор не понимаю всей логики Container View, но я просто хочу показать только одно представление внутри (не выполняя никаких подкачек или чего-то еще).
Любая помощь будет оценена, спасибо!
Итак, вы можете пересмотреть структуру.