iPhone Development: Game Kit, and What is a Picker?

So as usual, I wish someone had written this in a blog post. And now that I’ve figured it out, I’m paying it forward, so to speak.

The big revelation here is: if you’re using Game Kit (GK) foundation from Apple, iPhone development 3.x SDK, then you may encounter a networking object called “PeerPickerController”. It seems pretty obvious, but it really went over my head for a while. What is it? It’s an alert window that shows you the names of other BlueTooth, or WiFi devices in your vicinity.

Ta-da!

Here is a snapshot of one:

Some other tidbits:

When you are setting up a session, and a connection, the real final state of the connection is in a method called “did ChangeState”. The state that returns is a valid connection when it is: “GKPeerStateConnected”.

For some reason, working with this framework, there’s a lot of terms that seem obvious now, but were really confusing when we were cracking it:

– peer is any device, ANY DEVICE (including server)
– connection means literally an unsigned, ping out into the darkness
– session is on the client, and the server.

Also, (now I’m on a roll) some of this was new to me. The callbacks to this framework sometimes have nothing in them (and don’t log out STDOUT to your console):

(void)connectToPeer:(NSString *)peerID withTimeout:(NSTimeInterval)timeout{
}

I’m still muddling through this, but if I find out more I’ll post. Most relevant bits were from my teammate Stacie!

3 Comments »

  1. Comment by moonlight42

    Posted on April 23, 2010 at 9:27 am

    We are involved in mobile development, specialising in the iPhone, iPad, android and blackberry. Please look at our link: http://bit.ly/dbQ9BR

  2. Comment by Henry Duke

    Posted on June 12, 2012 at 9:51 am

    As getting started with iPhone development, it was great to know about some terms related to it such as peer and connection and session was something which I was knowing before. 

  3. Comment by Micheal Marke

    Posted on May 27, 2013 at 1:31 pm

    The Android Development
    range from social media apps to news and weather apps that includes,
    like educational games to music, movies to all sorts of entertainments
    that it can imagine.

Leave a comment

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>