我想将用户的年龄显示为字符串。我正在使用 Facebook API,我只看到生日日期,但看不到年龄值。是否可以将生日转换为年龄?这是我使用生日的代码:
[[[FBSDKGraphRequest alloc] initWithGraphPath:@"me"
parameters:@{ @"fields" : @"id,birthday)"}]startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection, id result, NSError *error) {
if (!error) {
NSString *ageOfLoginUser = [result valueForKey:@"birthday"];
self.age.text = ageOfLoginUser;
}
}];