我有一个名为 MatchmakingServer 的类有一个方法如下:
- (void)session:(GKSession *)session peer:(NSString *)peerID didChangeState:(GKPeerConnectionState)state
{
switch (state)
{
case GKPeerStateAvailable:
break;
case GKPeerStateUnavailable:
break;
// A new client has connected to the server.
case GKPeerStateConnected:
if (_serverState == ServerStateAcceptingConnections)
{
if (![_connectedClients containsObject:peerID])
{
NSString *peerID2 =[self displayNameForPeerID:peerID];
self.PeerId=peerID;
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Oops:("
message:[NSString stringWithFormat:@"%@:%@ %@",@"device",peerID2,@"want to join your session"]
delegate:self
cancelButtonTitle:@"NO"
otherButtonTitles:nil];
[_connectedClients addObject:peerID];
NSLog(@"the orginal peerID %@",peerID);
[self.delegate matchmakingServer:self clientDidConnect:peerID];
}
}
还
@interface MatchmakingServer : NSObject <GKSessionDelegate,UIAlertViewDelegate>
为什么 alertView 不调用 clickedButtonAtIndex 的任何想法