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 |
graphObject
Used to create a graph object, usually for use in posting a new graph object or action.
+ (NSMutableDictionary<FBGraphObject> *)
graphObject;
FBGraphObject.h
graphObjectWrappingDictionary:
Used to wrap an existing dictionary with a FBGraphObject
facade
Parameter | Keterangan |
---|---|
jsonDictionary | 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.
FBGraphObject.h
isGraphObjectID:sameAs:
Used to compare two FBGraphObject
s 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 FBGraphObject
s could represent the same object, but contain different
subsets of fields).
Parameter | Keterangan |
---|---|
anObject | An |
anotherObject | The |
+ (BOOL)
isGraphObjectID: | (id<FBGraphObject>)anObject |
sameAs: | (id<FBGraphObject>)anotherObject; |
FBGraphObject.h
openGraphActionForPost
Used to create a graph object that's provisioned for POST, usually for use in posting a new Open Graph Action.
+ (NSMutableDictionary<FBOpenGraphAction> *)
openGraphActionForPost;
FBGraphObject.h
openGraphObjectForPost
Used to create a graph object that's provisioned for POST, usually for use in posting a new Open Graph object.
+ (NSMutableDictionary<FBOpenGraphObject> *)
openGraphObjectForPost;
FBGraphObject.h
openGraphObjectForPostWithType:title:image:url:description:
Used to create a graph object that's provisioned for POST, usually for use in posting a new Open Graph object.
Parameter | Keterangan |
---|---|
type | The object type name, in the form namespace:typename |
title | A title for the object |
image | The image property for the object |
url | The url property for the object |
description | The description for the object |
+ (NSMutableDictionary<FBOpenGraphObject> *)
openGraphObjectForPostWithType: | (NSString *)type |
title: | (NSString *)title |
image: | (id)image |
url: | (id)url |
description: | (NSString *)description; |
FBGraphObject.h