game center sending friend request and invite alerts

Discussion in 'iOS Programming' started by ajay009ajay, Dec 7, 2011.

  1. ajay009ajay, Dec 7, 2011
    Last edited by a moderator: Dec 7, 2011

    ajay009ajay macrumors newbie

    Dec 7, 2011

    I have written code to send friend request but whenever I am clicking on "send" button the exc_bad_access error is occurring. Here is the part of code which send the request to another player.

    UIViewController* UVC=[[UIViewController alloc] init];    
        GKFriendRequestComposeViewController *friendRequestViewController = [[GKFriendRequestComposeViewController alloc] init];
        friendRequestViewController.composeViewDelegate = self;
        [[[CCDirector sharedDirector] openGLView] addSubview:tempInviteFriendView.view];
        [UVC presentModalViewController:friendRequestViewController animated: YES];
        [UVC release];
    My question is how the other player knows the request came and what code I should modify to accept invite and start the game? And also how to know the friend request is accepted by other friend?
  2. dejo Moderator


    Staff Member

    Sep 2, 2004
    The Centennial State
    What is the purpose of UVC (a pretty poorly named variable, by the way) in the above code?

Share This Page