-tableView:cellForRowAtIndexPath:没有被调用

Mud*_*til 2 iphone uitableview xcode4 ios5

我已经UITableView进入UIViewController并通过outlet和delegete连接,并且数据源被分配给自己.numberOfSectionsInTableView并且numberOfRowsInSection正在调用我尝试使用NSLog但是cellForRowAtIndexPath没有调用我的代码看起来像

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {

    NSLog(@" cellForRowAtIndexPath ");

    static NSString *CellIdentifier = @"CurrencyCell";

    CurrencyCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
    if (cell == nil) {
        cell = [[CurrencyCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier] ;
    }
    new *Obj = [appdelegate.array objectAtIndex:indexPath.row];


    cell.CurNameLabel.text = Obj.C_Name;
    cell.textLabel.text = @"sdfnhsdfndsio;";
    NSLog(@"C_Name %@", Obj.C_Name);

    return cell;
}
Run Code Online (Sandbox Code Playgroud)

任何一个电话我都会犯错误提前谢谢

App*_*ate 6

看来numberOfSectionsInTableViewnumberOfRowsInSection返回是0.如果是这种情况,那么将的cellForRowAtIndexPath不会被调用..

从上面的评论..似乎"YourAppDelegate"变量是null或yourArray是.尝试null保持这些委托的断点,检查它们返回的值