如何从Game Center获得GKPlayer的状态? [英] How do I get a GKPlayer's status from Game Center?

查看:101
本文介绍了如何从Game Center获得GKPlayer的状态?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我获得 GKLocalPlayer 或使用 loadPlayersForIdentifiers:identifiers withCompletionHandler:获取列表或个人 GKPlayer 别名,记录时的 GKPlayer 对象,如下所示:

When I get a GKLocalPlayer or use loadPlayersForIdentifiers:identifiers withCompletionHandler: to get a list or individual GKPlayer aliases, the GKPlayer object when logged, looks something like this:

2010-09-23 10:39:01.759 Cee-lo[76500:207] Players loaded by identity: (
    "<GKPlayer 0x84125a0>(playerID: G:1234567890, alias: typeonetester1, status: Adding test friends., rid:(null))",
    "<GKPlayer 0x8412530>(playerID: G:1234567890, alias: typeonetester2, status: Adding Game Center to app, rid:(null))"
)

我的问题是,如何获得来自此对象的 status ,这个对象的类型究竟是什么? GKPlayer 类,所以当我做类似的事情时:

My question is, how do I get the status from this object, and what exactly is the type of this object? There is no "rid" or "status" property in the GKPlayer class, so when I do something like:

GKPlayer *player = [self.friends objectAtIndex:row];

cell.nameLabel.text = player.alias;
cell.statusLabel.text = player.status;

我收到请求成员'状态',而不是结构或联合错误。

I get a "Request for member 'status' in something not a structure or union" error.

推荐答案

Apple工程师回答:

Answered by an Apple engineer:


球员的身份不是
无障碍财产。在4.1 beta和&之一中改变了
。在
中注明4.1 relnotes。

The players' status is not an accessible property. This was changed in one of the 4.1 betas & is noted in the 4.1 relnotes.

这篇关于如何从Game Center获得GKPlayer的状态?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆