У меня есть UITableView, который я добавляю динамически через initWithFrame.
- (void)twitterUpdate {
twitterTable = [[UITableView alloc] initWithFrame:CGRectMake(40, 100, 420, 750)];
twitterTable.delegate = self;
twitterTable.backgroundColor = [UIColor clearColor];
twitterTable.separatorColor = [UIColor darkGrayColor];
twitterTable.dataSource = self;
[twitterView addSubview:twitterTable];
}
К сожалению,
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
не вызывается, хотя у меня
<UITableViewDataSource, UITableViewDelegate>
определено в моем заголовке.
Есть идеи, почему это не называется? TwitterUpdate вызывается через
[self performSelectorOnMainThread:@selector(twitterUpdate) withObject:self waitUntilDone:YES];
и рисует таблицу на странице. У меня также есть
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
возвращает действительный NSInteger.
Разве вы не можете динамически создавать подобные таблицы?