在IOS上显示好友Facebook

在IOS上显示好友Facebook,facebook,storyboard,fbrequest-form,Facebook,Storyboard,Fbrequest Form,我在显示好友列表facebook时遇到问题,我正在使用FBRequest,我已经获得好友列表,但它没有显示在UITableView中 这是我的密码: -(void)viewDidLoad { [self.tblView setDataSource:self]; [self.tblView setDelegate:self]; [超级视图下载]; [自动加载优先]; _ItemsNameFriend=[[NSMutableArray alloc]init]; if(FBSession.active

我在显示好友列表facebook时遇到问题,我正在使用FBRequest,我已经获得好友列表,但它没有显示在UITableView中

这是我的密码:

-(void)viewDidLoad
{
[self.tblView setDataSource:self];
[self.tblView setDelegate:self];
[超级视图下载];
[自动加载优先];
_ItemsNameFriend=[[NSMutableArray alloc]init];
if(FBSession.activeSession.isOpen){
FBRequest*friendRequest=[[FBRequest alloc]initWithSession:FBSession.activeSession图形路径:@“我/朋友”];
[friendRequest startWithCompletionHandler:^(FBRequestConnection*连接,id结果,NSError*错误){
NSDictionary*resultDictionary=(NSDictionary*)结果;
_ItemsNameFriend=[resultDictionary objectForKey:@“数据”];
NSLog(@“%@”,_itemsNamesFriend);//-->有数据
}];
NSLog(@“%@,_itemsNamesFriend);//-->数据为空
[self.tblView reloadData];
}
}
-(NSInteger)表格视图中的节数:(UITableView*)表格视图
{
返回1;
}
-(NSInteger)表视图:(UITableView*)表视图行数节:(NSInteger)节
{
//NSLog(@“%d”,_itemsNamesFriend.count);
返回_itemsNamesFriend.count;
}

对块内变量所做的任何修改都不会显示在块外。因此,您需要使用_块声明它们,以便块内所做的修改在外部可见

这是您需要在.h文件中执行的操作

__block NSMutableArray* _itemsNamesFriend;
这应该能解决你的问题