The FBFriendPickerViewController
class creates a controller object that manages
the user interface for displaying and selecting Facebook friends.
When the FBFriendPickerViewController
view loads it creates a UITableView
object
where the friends will be displayed. You can access this view through the tableView
property. The friend display can be sorted by first name or last name. Friends'
names can be displayed with the first name first or the last name first.
The friend data can be pre-fetched and cached prior to using the view controller. The cache is setup using an FBCacheDescriptor object that can trigger the data fetch. Any friend data requests will first check the cache and use that data. If the friend picker is being displayed cached data will initially be shown before a fresh copy is retrieved.
The delegate
property may be set to an object that conforms to the FBFriendPickerDelegate
protocol. The delegate
object will receive updates related to friend selection and
data changes. The delegate can also be used to filter the friends to display in the
picker.
Inherits from: | FBPeoplePickerViewController |
Declared in: | FBFriendPickerViewController.h |
selection
The list of friends that are currently selected in the view. The items in the array are FBGraphUser objects.
@property (nonatomic,
copy,
readwrite) NSArray *selection;
You can set this this array to pre-select items in the picker. The objects in the array must be complete idFBGraphUser objects (i.e., fetched from a Graph query or from a previous picker's selection, with id and appropriate name fields).
cacheDescriptor
Creates a cache descriptor based on default settings of the FBFriendPickerViewController
object.
+ (FBCacheDescriptor *)
cacheDescriptor;
An FBCacheDescriptor
object may be used to pre-fetch data before it is used by
the view controller. It may also be used to configure the FBFriendPickerViewController
object.
cacheDescriptorWithUserID:fieldsForRequest:
Creates a cache descriptor with additional fields and a profile ID for use with the FBFriendPickerViewController
object.
參數 | 說明 |
---|---|
userID | The profile ID of the user whose friends will be displayed. A nil value implies a "me" alias. |
fieldsForRequest | The set of additional fields to include in the request for friend data. |
+ (FBCacheDescriptor *)
cacheDescriptorWithUserID: | (NSString *)userID |
fieldsForRequest: | (NSSet *)fieldsForRequest; |
An FBCacheDescriptor
object may be used to pre-fetch data before it is used by
the view controller. It may also be used to configure the FBFriendPickerViewController
object.
configureUsingCachedDescriptor:
Configures the properties used in the caching data queries.
參數 | 說明 |
---|---|
cacheDescriptor | The containing the cache query properties. |
- (void)
configureUsingCachedDescriptor:(FBCacheDescriptor *)cacheDescriptor;
Cache descriptors are used to fetch and cache the data used by the view controller. If the view controller finds a cached copy of the data, it will first display the cached content then fetch a fresh copy from the server.