我可以使用Facebook的FBGraphObject SDK的范围之内?(Can I use FB

2019-10-28 16:04发布

FBGraphObject的功能是非常有用的,访问和设置的NSMutableDictionary通过点符号是一个很好的功能。 从更多信息这里 。

我有一个协议鸭子。

@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);

上面的代码工作正常。

所以我的问题是,是否有任何问题/问题使用FBGraphObject FacebookSDK范围之外时,就像上面的代码?

文章来源: Can I use FBGraphObject outside the scope of Facebook SDK?