This class is no longer available in the most recent version of the SDK.
A more recent version of this class is available. Check out the latest version.

Static class with helpers for use with graph objects


The public interface of this class is useful for creating objects that have the same graph characteristics of those returned by methods of the SDK. This class also represents the internal implementation of the FBGraphObject protocol, used by the Facebook SDK. Application code should not use the FBGraphObject class to access instances and instance members, favoring the protocol.

Conforms to:FBGraphObject
Inherits from:NSMutableDictionary
Declared in:FBGraphObject.h
Class Methods

Used to create a graph object, usually for use in posting a new graph object or action.

+ (NSMutableDictionary<FBGraphObject> *) graphObject;
Declared In: FBGraphObject.h

Used to wrap an existing dictionary with a FBGraphObject facade


The dictionary representing the underlying object to wrap

+ (NSMutableDictionary<FBGraphObject> *) graphObjectWrappingDictionary:(NSDictionary *)jsonDictionary;

Normally you will not need to call this method, as the Facebook SDK already "FBGraphObject-ifys" json objects fetch via FBRequest and FBRequestConnection. However, you may have other reasons to create json objects in your application, which you would like to treat as a graph object. The pattern for doing this is that you pass the root node of the json to this method, to retrieve a wrapper. From this point, if you traverse the graph, any other objects deeper in the hierarchy will be wrapped as FBGraphObject's in a lazy fashion.

This method is designed to avoid unnecessary memory allocations, and object copying. Due to this, the method does not copy the source object if it can be avoided, but rather wraps and uses it as is. The returned object derives callers shoudl use the returned object after calls to this method, rather than continue to call methods on the original object.

Declared In: FBGraphObject.h

Used to compare two FBGraphObjects to determine if represent the same object. We do not overload the concept of equality as there are various types of equality that may be important for an FBGraphObject (for instance, two different FBGraphObjects could represent the same object, but contain different subsets of fields).


An FBGraphObject to test


The FBGraphObject to compare it against

+ (BOOL)
isGraphObjectID: (id<FBGraphObject>)anObject
sameAs: (id<FBGraphObject>)anotherObject;
Declared In: FBGraphObject.h

Used to create a graph object that's provisioned for POST, usually for use in posting a new Open Graph Action.

+ (NSMutableDictionary<FBOpenGraphAction> *) openGraphActionForPost;
Declared In: FBGraphObject.h

Used to create a graph object that's provisioned for POST, usually for use in posting a new Open Graph object.

+ (NSMutableDictionary<FBOpenGraphObject> *) openGraphObjectForPost;
Declared In: FBGraphObject.h

Used to create a graph object that's provisioned for POST, usually for use in posting a new Open Graph object.


The object type name, in the form namespace:typename


A title for the object


The image property for the object


The url property for the object


The description for the object

+ (NSMutableDictionary<FBOpenGraphObject> *)
openGraphObjectForPostWithType: (NSString *)type
title: (NSString *)title
image: (id)image
url: (id)url
description: (NSString *)description;
Declared In: FBGraphObject.h