numberOfRowsInSection被调用,但是没有调用cellForRowAtIndexPath [英] numberOfRowsInSection called but cellForRowAtIndexPath not called

查看:640
本文介绍了numberOfRowsInSection被调用,但是没有调用cellForRowAtIndexPath的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的tableView中, numberOfRowsInSection 被调用两次,但是 cellForRowAtIndexPath 未被调用?我想在tableView中显示Facebook的好友列表(如果cellForRowAtIndexPath称为我的问题解决了)。

In my tableView numberOfRowsInSection is called two times but cellForRowAtIndexPath not called ? I wants to display Facebook friends list in tableView (if cellForRowAtIndexPath called my problem solved).

我在这里的数组中获得正确的值,解析朋友列表不完成它不会转到 cellForRowAtIndexPath ,但是下一次当我重新加载数据时,在 numberOfRowsInSection 中显示值为194(我的朋友在facebood中),但仍然不会的cellForRowAtIndexPath 即可。我非常厌倦了这个问题?

I get the right value in my array here but First time when table method called because parsing of friend list not complete it not goes to cellForRowAtIndexPath but next time when I reload data it shows value 194(my friends in facebood) in numberOfRowsInSection but still not goes cellForRowAtIndexPath. I am very tired with that problem ?

@implement RootViewController


//In this view i do two things. First use FBFeedPost to Fetch the Friend List from    Facebook and Second navigate to FBFriends view



FBFeedPost *post = [[FBFeedPost alloc]initWithFriendList:self.imageView.image];
    [post publishPostWithDelegate:self];


FBFriends *friendList=[[FBFriends alloc]initWithNibName:@"FBFriends" bundle:[NSBundle mainBundle]];
[[self navigationController] pushViewController:friendList  animated:YES];

@end


@implement FBFeedPost

//After parsing friends list i pass Array to a FBFriend class function   

FBFriends *obj1=[[FBFriends alloc]init];
[obj1 getFreindName:nameItems];

@end



@implement FBFriends


-(void)getFreindName:(NSMutableArray *)friendName
{
    friendsArray=friendName;

    NSLog(@"the count of name is %d",[friendsArray count]);// here i get right answer.

    [self.tableView reloadData];

}


@end


推荐答案

@ Stack.Blue:你有什么属性用于tableView?使用 @property(nonatomic,retain)UITableView * tableView;
或下一个选项,您可以尝试在 viewWillAppear 方法中添加表。请让我知道是否有效。

@Stack.Blue:ok what property have you used for tableView??Use @property(nonatomic,retain)UITableView *tableView; or next option is you can try adding the table in viewWillAppear method.Do let me know if it works.

这篇关于numberOfRowsInSection被调用,但是没有调用cellForRowAtIndexPath的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆