Facebook Developers
DocsToolsSupportNewsApps
Log In
  • Social Plugins
  • Facebook Login
  • Open Graph
  • Facebook APIs
  • Games
  • Payments
  • App Center
  • Promote Your App
  • iOS
    • Getting Started
    • Concepts
    • Reference
  • Android
  • JavaScript
  • PHP
  • More SDKs
  • Class References
    • FBCacheDescriptor
    • FBFriendPickerViewController
    • FBGraphObject
    • FBLoginView
    • FBPlacePickerViewController
    • FBProfilePictureView
    • FBRequest
    • FBRequestConnection
    • FBSession
    • FBSessionTokenCachingStrategy
    • FBTestSession
    • FBUserSettingsViewController
    • FBViewController
  • Protocol References
    • FBFriendPickerDelegate
    • FBGraphLocation
    • FBGraphObject
    • FBGraphPlace
    • FBGraphUser
    • FBLoginViewDelegate
    • FBOpenGraphAction
    • FBPlacePickerDelegate
    • FBUserSettingsDelegate
    • FBViewControllerDelegate
  • Other References
    • FBError
    • FBSettings

FBPlacePickerViewController

SDK Reference › iOS SDK › FBPlacePickerViewController
FBPlacePickerViewController
Inherits from: FBViewController
Declared in: FBPlacePickerViewController.h
Overview

The FBPlacePickerViewController class creates a controller object that manages the user interface for displaying and selecting nearby places.

Discussion

When the FBPlacePickerViewController view loads it creates a UITableView object where the places near a given location will be displayed. You can access this view through the tableView property.

The place 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 place data requests will first check the cache and use that data. If the place 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 FBPlacePickerDelegate protocol. The delegate object will receive updates related to place selection and data changes. The delegate can also be used to filter the places to display in the picker.

Tasks
fieldsForRequest property
itemPicturesEnabled property
locationCoordinate property
radiusInMeters property
resultsLimit property
searchText property
selection property
session property
spinner property
tableView property
+ cacheDescriptorWithLocationCoordinate:radiusInMeters:searchText:resultsLimit:fieldsForRequest:
- clearSelection
- configureUsingCachedDescriptor:
- init
- initWithCoder:
- initWithNibName:bundle:
- loadData
Properties
fieldsForRequest

Addtional fields to fetch when making the Graph API call to get place data.

@property (nonatomic, copy) NSSet *fieldsForRequest;
Declared In
FBPlacePickerViewController.h
itemPicturesEnabled

A Boolean value that indicates whether place profile pictures are displayed.

@property (nonatomic) BOOL itemPicturesEnabled;
Declared In
FBPlacePickerViewController.h
locationCoordinate

The coordinates to use for place discovery.

@property (nonatomic) CLLocationCoordinate2D locationCoordinate;
Declared In
FBPlacePickerViewController.h
radiusInMeters

The radius to use for place discovery.

@property (nonatomic) NSInteger radiusInMeters;
Declared In
FBPlacePickerViewController.h
resultsLimit

The maximum number of places to fetch.

@property (nonatomic) NSInteger resultsLimit;
Declared In
FBPlacePickerViewController.h
searchText

The search words used to narrow down the results returned.

@property (nonatomic, copy) NSString *searchText;
Declared In
FBPlacePickerViewController.h
selection

The place that is currently selected in the view. This is nil if nothing is selected.

@property (nonatomic, retain, readonly) id<FBGraphPlace> selection;
Declared In
FBPlacePickerViewController.h
session

The session that is used in the request for place data.

@property (nonatomic, retain) FBSession *session;
Declared In
FBPlacePickerViewController.h
spinner

Returns an outlet for the spinner used in the view controller.

@property (nonatomic, retain) IBOutlet UIActivityIndicatorView *spinner;
Declared In
FBPlacePickerViewController.h
tableView

Returns an outlet for the table view managed by the view controller.

@property (nonatomic, retain) IBOutlet UITableView *tableView;
Declared In
FBPlacePickerViewController.h
Class Methods
cacheDescriptorWithLocationCoordinate:radiusInMeters:searchText:resultsLimit:fieldsForRequest:

Creates a cache descriptor with additional fields and a profile ID for use with the FBPlacePickerViewController object.

+ (FBCacheDescriptor*)cacheDescriptorWithLocationCoordinate:(CLLocationCoordinate2D)locationCoordinate radiusInMeters:(NSInteger)radiusInMeters searchText:(NSString*)searchText resultsLimit:(NSInteger)resultsLimit fieldsForRequest:(NSSet*)fieldsForRequest;
Parameter
locationCoordinate

The coordinates to use for place discovery.

radiusInMeters

The radius to use for place discovery.

searchText

The search words used to narrow down the results returned.

resultsLimit

The maximum number of places to fetch.

fieldsForRequest

Addtional fields to fetch when making the Graph API call to get place data.

Discussion

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 FBPlacePickerViewController object.

Declared In
FBPlacePickerViewController.h
Instance Methods
clearSelection

Clears the current selection, so the picker is ready for a fresh use.

- (void)clearSelection;
Declared In
FBPlacePickerViewController.h
configureUsingCachedDescriptor:

Configures the properties used in the caching data queries.

- (void)configureUsingCachedDescriptor:(FBCacheDescriptor*)cacheDescriptor;
Parameter
cacheDescriptor

The containing the cache query properties.

Discussion

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.

Declared In
FBPlacePickerViewController.h
init

Initializes a place picker view controller.

- (id)init;
Declared In
FBPlacePickerViewController.h
initWithCoder:

Initializes a place picker view controller.

- (id)initWithCoder:(NSCoder *)aDecoder;
Parameter
aDecoder

An unarchiver object.

Declared In
FBPlacePickerViewController.h
initWithNibName:bundle:

Initializes a place picker view controller.

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil;
Parameter
nibNameOrNil

The name of the nib file to associate with the view controller. The nib file name should not contain any leading path information. If you specify nil, the nibName property is set to nil.

nibBundleOrNil

The bundle in which to search for the nib file. This method looks for the nib file in the bundle's language-specific project directories first, followed by the Resources directory. If nil, this method looks for the nib file in the main bundle.

Declared In
FBPlacePickerViewController.h
loadData

Initiates a query to get place data the first time or in response to changes in the search criteria, filter, or location information.

- (void)loadData;
Discussion

A cached copy will be returned if available. The cached view is temporary until a fresh copy is retrieved from the server. It is legal to call this more than once.

Declared In
FBPlacePickerViewController.h

Last Updated: November 19, 2012
Facebook © 2013 · English (US)
AboutAdvertisingCareersPlatform PoliciesPrivacy Policy