Sto usando il seguente codice per creare un'istanza del SenderPlayerViewController vista e passare il "sessione" oggetto:selettore copyWithZone-non riconosciuto inviato esempio
- (void)session:(GKSession *)session peer:(NSString *)peerID didChangeState: GKPeerConnectionState)state {
switch (state) {
case GKPeerStateConnected:
NSLog(@"Connected Central");
if ([settings.playerType isEqualToString:@"SENDER"]){
SenderPlayerViewController *myViewController = [[UIStoryboard storyboardWithName:@"MainStoryboard" bundle:NULL] instantiateViewControllerWithIdentifier:@"SenderPlayerViewController"];
[self.navigationController pushViewController:myViewController animated:YES];
myViewController.currentSession=session;
}
break;
case GKPeerStateDisconnected:
NSLog(@"Disconnected Central");
self.currentSession = nil;
break;
}
}
Il file di intestazione di vista SenderPlayerViewController è:
@interface CentralViewController : UIViewController {
Settings *settings;}
@property (nonatomic, copy) GKSession *currentSession;
@end
Quando il codice viene eseguito ottengo il seguente errore:
[GKSession copyWithZone:]: unrecognized selector sent to instance 0x9661200
hanno bisogno di più aiuto qui ....