GKPeerPickerController Class Reference
| Inherits from | |
| Conforms to | |
| Framework | /System/Library/Frameworks/GameKit.framework |
| Availability | Available in iOS 3.0 and later. |
| Companion guide | |
| Declared in | GKPeerPickerController.h |
Overview
The GKPeerPickerController class provides a standard user interface to allow one iOS device to discover and connect to another. The result is a configured GKSession object connecting the two devices. To use a GKPeerPickerController object, your application creates the controller, adds a delegate, configures the allowed connection types, and then shows the peer picker. The delegate is called as the user makes selections within the peer picker interface.
In iOS 3.0, the peer picker can be configured to select between Bluetooth and Internet connections.
On iOS 3.0, your application should release the peer picker object after it dismisses the peer picker dialog. On iOS 3.1 or later, your application may release the peer picker after it is shown to the user. If you do this, the peer picker controller is automatically deallocated after the dialog is dismissed.
Tasks
Setting and Getting the Delegate
-
delegateproperty
Displaying the Picker Dialog
Configuring Connectivity Options
-
connectionTypesMaskproperty
Properties
connectionTypesMask
A mask that determines the types of connections a dialog presents to the user.
Discussion
Your application configures the connection types it allows before showing the peer picker. If your application allows more than one connection type, the peer picker offers the user a choice of which type of connection to use. The default value for the mask is GKPeerPickerConnectionTypeNearby.
Availability
- Available in iOS 3.0 and later.
Declared In
GKPeerPickerController.hdelegate
The delegate of the peer picker controller.
Discussion
The delegate must adopt the GKPeerPickerControllerDelegate formal protocol.
Availability
- Available in iOS 3.0 and later.
Declared In
GKPeerPickerController.hvisible
A Boolean value that indicates whether the picker dialog is visible. (read-only)
Availability
- Available in iOS 3.0 and later.
Declared In
GKPeerPickerController.hInstance Methods
dismiss
Hides the peer picker dialog.
Discussion
The controller’s delegate is responsible for dismissing the peer picker when it is no longer needed.
On iOS 3.1 or later, the peer picker is retained when it is shown, and autoreleased when it is dismissed.
Availability
- Available in iOS 3.0 and later.
Declared In
GKPeerPickerController.hConstants
GKPeerPickerConnectionType
Network connections available to the peer picker dialog.
enum {
GKPeerPickerConnectionTypeOnline = 1 << 0,
GKPeerPickerConnectionTypeNearby = 1 << 1
};
typedef NSUInteger GKPeerPickerConnectionType;
Constants
© 2010 Apple Inc. All Rights Reserved. (Last updated: 2010-10-25)