当我尝试print在Python中使用语句时,它给了我这个错误:
>>> print "Hello, World!"
File "<stdin>", line 1
print "Hello, World!"
^
SyntaxError: Missing parentheses in call to 'print'
Run Code Online (Sandbox Code Playgroud)
那是什么意思?
我试图用Graph API v2.0获取我的朋友姓名和ID,但数据返回空:
{
"data": [
]
}
Run Code Online (Sandbox Code Playgroud)
当我使用v1.0时,以下请求一切正常:
FBRequest* friendsRequest = [FBRequest requestForMyFriends];
[friendsRequest startWithCompletionHandler: ^(FBRequestConnection *connection,
NSDictionary* result,
NSError *error) {
NSArray* friends = [result objectForKey:@"data"];
NSLog(@"Found: %i friends", friends.count);
for (NSDictionary<FBGraphUser>* friend in friends) {
NSLog(@"I have a friend named %@ with id %@", friend.name, friend.id);
}
}];
Run Code Online (Sandbox Code Playgroud)
但现在我不能得到朋友!
facebook facebook-graph-api facebook-ios-sdk facebook-graph-api-v2.0