FBGraphObject
最新版的 SDK 已不支持此类。
这个类有新版本。查看 最新版本。

Static class with helpers for use with graph objects

Discussion:

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

参数描述
jsonDictionary

The dictionary representing the underlying object to wrap

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

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 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).

参数描述
anObject

An FBGraphObject to test

anotherObject

The FBGraphObject to compare it against

+ (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.

参数描述
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