2

私のtableView numberOfRowsInSectionは2回呼び出されますが、cellForRowAtIndexPathは呼び出されませんか? Facebookの友達リストをtableViewに表示したい(cellForRowAtIndexPathが私の問題を解決したと呼ばれる場合)。

ここで配列に正しい値を取得しますが、最初に友人リストの解析が完了していないためにテーブルメソッドが呼び出されたときはcellForRowAtIndexPathに移動しませんが、次回データをリロードすると numberOfRowsInSection に値 194 (facebood の友人) が表示されますが、まだ表示されません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
4

1 に答える 1

2

@Stack.Blue:ok tableView にどのプロパティを使用しましたか??使用@property(nonatomic,retain)UITableView *tableView; または次のオプションは、メソッドにテーブルを追加してみることができますviewWillAppear。動作するかどうか教えてください。

于 2012-06-29T06:39:52.533 に答える