Re: Can MCPeerID be used as a key in a dictionary?
Re: Can MCPeerID be used as a key in a dictionary?
- Subject: Re: Can MCPeerID be used as a key in a dictionary?
- From: "Quinn \"The Eskimo!\"" <email@hidden>
- Date: Fri, 23 May 2014 11:14:31 +0100
On 23 May 2014, at 10:54, Rick Mann <email@hidden> wrote:
> One more thing, is it appropriate to archive it in the iCloud KVS so that a person appears the same across all their devices?
That comes back to the question of identity. Is Quinn on Mumford (my iPhone) the same as Quinn on Io (my iPad). I suspect that the answer is no, because if you make them the same then I won't be able to communicate between Mumford and Io.
Regardless, if you do send MCPeerID archives between machines (via iCloud or whatever) you will have to be careful about collisions. Multipeer Connectivity expects them to be unique and, while I haven't tried this myself, I doubt it'll behave well if two identical peers try to come online.
Remember that Multipeer Connectivity is implemented in terms of Bonjour. The big random number for the peer is actually used as the Bonjour service name, and Bonjour won't let you register two services with the same name and type in the same domain.
WARNING: The Bonjour stuff is an implementation detail. Don't build this knowledge into your code otherwise you may break as the implementation evolves.
Share and Enjoy
--
Quinn "The Eskimo!" <http://www.apple.com/developer/>
Apple Developer Relations, Developer Technical Support, Core OS/Hardware
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden