小编Phi*_*lip的帖子

Selector在numberOfRowsInSection中调用,但不在cellForRowAtIndexPath中调用

我有这个代码来填充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)

iphone objective-c uitableview

1
推荐指数
1
解决办法
1074
查看次数

标签 统计

iphone ×1

objective-c ×1

uitableview ×1