我有这个代码来填充UITableView,返回numberOfRowsInSection的工作正常.不调用在cellForRowAtIndexPath部分中使用appDelegate的选择器.这里有什么不对?
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
// Return the number of rows in the section.
VIP_GeburtstagAppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
[appDelegate getEntriesForDate:section];
return appDelegate.namesForDay.count;
}
// Customize the appearance of table view cells.
- (UITableViewCell *)tableView:(UITableView *)theTableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *CellIdentifier = @"Cell";
VIP_GeburtstagAppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
[appDelegate getEntriesForDate:indexPath.section];
Run Code Online (Sandbox Code Playgroud)