PDA

View Full Version : Bonjour example from "More iPhone Development"




idelovski
Aug 18, 2010, 07:32 AM
I hope someone here is having this Apress book by Mark/LaMarche (http://apress.com/book/view/9781430225058). I have problem with the example from chapter 9, Online Play: Bonjour and Network Streams.

With online play, after I play the game few times, one of the devices would get stuck in some sort of limbo waiting instead of starting a fresh new game. Other device is OK, having the text "Your turn" or "Opponent's Turn" at the top, ready to start a game, while other device has nothing at the top and I can't play on it any more.

It seems as if it waits for acknowledgement, but it never comes so it just sits there waiting.

Then I made few changes in the code so I can use it with the simulator. Only few minor tweaks related to endianness. When I run the game in the simulator, it is always the real device that gets stuck, never the application in the simulator so I can't use debugger to see what is going on.

It happens with both the code I typed from the book as well as with the code from the download. Any ideas?