Need some help with the following objective-c syntax:
[error.userInfo[FBErrorParsedJSONResponseKey][@"body"][@"error"][@"type"] isEqualToString:@"OAuthException"]
Whats going on here? How are body,error and type literals being used?
Here's the complete block call:
[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);
}
}];
I have also seen syntax like
self.userProfile = [PFUser currentUser][@"profile"];
where userProfile
is an NSDictionary
and [PFUser currentUser]
returns PFUser
.
How does [PFUser][@"profile]
initialize a dictionary?