November 2011
Beginner
238 pages
6h 19m
English
iOS 5.0 adds support for friends' avatars. Players are required to set their avatar in the Game Center app. If they have not set an avatar, Game Center will assign them a default avatar. To access avatars in your app, you will need to be running on iOS 5.0 or newer, and you will need to implement one new method. The following method is called on an existing GKPlayer object (see the previous section for more information on GKPlayer). There are two options for avatar image sizes: GKPhotoSizeNormal and GKPhotoSizeSmall. As of iOS 5.0 beta 4, they are undefined sizes, so you will need to experiment with them to see which offers the image size you need.
[player loadPhotoForSize:GKPhotoSizeNormal withCompletionHandler: ^(UIImage ...