问题
The functionality of FBGraphObject is quite useful, accessing and setting the NSMutableDictionary via dot notation is a nice feature to have. More info from here.
I have a protocol Duck.
@protocol Duck <FBGraphObject>
@property (nonatomic, strong) NSNumber *objectID; // id key
@property (nonatomic, strong) NSString *name;
@property (nonatomic, strong) NSString *description;
@end
// Now I can do this.
NSDictionary *anAnimal = @{@"id":@1, @"name":@"donald", @"description":@"Its a duck that talks!!"};
NSMutableDictionary <Duck> *aDuck = (NSMutableDictionary <Duck> *) [FBGraphObject graphObjectWrappingDictionary:anAnimal];
NSLog(@"aDuck name via Key: %@",[aDuck objectForKey:@"name"]);
NSLog(@"aDuck name via Dot Notation: %@",aDuck.name);
NSLog(@"aDuck description via Key: %@",[aDuck objectForKey:@"description"]);
NSLog(@"aDuck description via Dot Notation: %@",aDuck.description);
The code above works fine.
So my question is, are there any issues/problem when using the FBGraphObject outside the scope of FacebookSDK, Just like the code above?
来源:https://stackoverflow.com/questions/25278617/can-i-use-fbgraphobject-outside-the-scope-of-facebook-sdk