在我的表视图中节中的行数被调用两次但是cellForRowAtIndexPath不叫?我想在 tableView 中显示 Facebook 好友列表(如果 cellForRowAtIndexPath 调用我的问题就解决了)。
我在这里的数组中得到了正确的值,但是第一次调用表方法时,因为朋友列表的解析未完成,所以它不会去cellForRowAtIndexPath但下次当我重新加载数据时,它显示值 194(我在 facebook 中的朋友)节中的行数但还是没有去cellForRowAtIndexPath。我对这个问题感到非常厌倦?
@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
方法。请告诉我它是否有效。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)