需要以下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]
初始化字典?