Search code examples
iosexpressionallocgkpeerpickercontroller

GKPeerPickerController throwing exception "expected expression"


I have written this little piece of code:

GKPeerPickerController *picker = [[GKPeerPickerController alloc] init];

but even after restarting my Mac XCode is telling me: "expected expression"! Anyone having any idea solving this problem?

Thanks


Solution

  • I think you are creating picker object in switch case. Put your code in curly braces.

    case k:
    {
         GKPeerPickerController *picker = [[GKPeerPickerController alloc] init];
         //your code
    }