需要以下objective-c语法的帮助:
[error.userInfo[FBErrorParsedJSONResponseKey][@"body"][@"error"][@"type"] isEqualToString:@"OAuthException"]
这是怎么回事?如何使用正文,错误和类型文字?
这是完整的块调用:
[request startWithCompletionHandler:^(FBRequestConnection *connection, id result, NSError *error) {
if (!error) {
// handle successful response
} else if ([error.userInfo[FBErrorParsedJSONResponseKey][@"body"][@"error"][@"type"] isEqualToString:@"OAuthException"]) {
NSLog(@"The facebook session was invalidated");
[self logoutButtonTouchHandler:nil];
} else {
NSLog(@"Some other error: %@", error);
}
}];
我也看过类似
的语法self.userProfile = [PFUser currentUser][@"profile"];
其中userProfile
是NSDictionary
,[PFUser currentUser]
返回PFUser
。
[PFUser][@"profile]
如何初始化字典?