I have a UITableView that I am adding dynamically via a 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];
}
Unfortunately,
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
is not being called though I have
<UITableViewDataSource, UITableViewDelegate>
defined in my header.
Any ideas as to why this is not called? twitterUpdate is being called via
[self performSelectorOnMainThread:@selector(twitterUpdate) withObject:self waitUntilDone:YES];
and is drawing the table to the page. I also have
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
returning a valid NSInteger.
Are you not able to dynamically create tables like this?
Make sure you call: