1

I have an EAGLView-based class that runs the following code when a menu selection is made in OpenGL:

-(void) startPicker
{
    self.gameState = kStatePicker;
    GKPeerPickerController *picker = [[GKPeerPickerController alloc] init];
    picker.delegate = self;
    picker.connectionTypesMask = GKPeerPickerConnectionTypeNearby;
    [picker show];
}

For some unknown reason, the picker is a blank rounded rect when it appears, with no visible interface or directions.

If I launch it at the end of my init function, it works. Afterward, it launches fine from the menu. I have tried placing the code in startPicker inside a main queue dispatch, but that doesn't seem to help. I've tried running the picker with and without ARC, but that makes no difference. This code is more or less directly taken from the GKTank example that Apple provided a while ago, to introduce GameKit's bluetooth framework.

Can anyone tell me why this might be happening, and what a possible solution is?

LotusCloud
  • 11
  • 1
  • Could you try calling this method on the main thread: [self performSelectorOnMainThread:@selector(startPicker)] and see if this solves the issue. – Matic Oblak May 10 '13 at 07:03
  • I tried: [self performSelectorOnMainThread:@selector(startPicker) withObject:self waitUntilDone:YES]; and the problem still exists. – LotusCloud May 10 '13 at 23:28

1 Answers1

0

Just following up. I discovered in the view controller that contains this view that there was a call to [UIView setAnimations:NO]; This prohibits GKPeerPickerController from appearing properly.

LotusCloud
  • 11
  • 1