0

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?

Community
  • 1
  • 1
otakuProgrammer
  • 298
  • 2
  • 12
  • 1
    You can just use the FBGraphObject source (and all its dependencies) without including the rest of the Facebook SDK. – jbat100 Aug 15 '14 at 12:57
  • Thanks for replying.. Im guessing its ok to use the class for other purposes then...i tested the some examples it works fine too – otakuProgrammer Aug 15 '14 at 23:54

0 Answers0