我设法恢复下面的代码中指定的所有信息,但我无法检索user.location的纬度和经度。如何从Facebook用户位置获取经度和纬度?
- (void)loginViewFetchedUserInfo:(FBLoginView *)loginView user:(id<FBGraphUser>)user {
NSString *fbUsername = [NSString stringWithFormat:@"%@",user.username];
NSString *fbNickname = [NSString stringWithFormat:@"%@",user.name];
NSString *fbName = [NSString stringWithFormat:@"%@",user.first_name];
NSString *fbSurname = [NSString stringWithFormat:@"%@",user.last_name];
NSString *fbLocation = [NSString stringWithFormat:@"%@",user.location.name];
}
请帮帮我!
我不知道回答你的问题,但也绝对没有一点使用stringWithFormat :@“%@”。摆脱整个结构。这只会让系统无缘无故地进行额外的工作。只需使用如fbName = user.first_name; –