Can I use FBGraphObject outside the scope of Facebook SDK?

我的未来我决定 提交于 2020-01-17 02:58:10

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!