开发者

for each publish,how can i make my device name as unique?

i am publishing my netService object once with same domain and name. another device finding my service as myService .

but again i publishing my netService object again with same domain and name .another device will detect my devise as myService(1).

code:

self.netService = [[NSNetService alloc] initWithDomain:domain type:protocol name:name port:self.port];
if(self.netService == nil)
    return NO;

[self.netService scheduleInRunLoop:[NSRunLoop currentRunLoop] forMode:NSRunLoopCommonModes];
****[self.netService publish];****
[self.netService set开发者_如何学CDelegate:self];

for each publish,how can i make my device name as unique?


You can use unique Device Id for this:

NSString* deviceID = [ UIDevice currentDevice ].uniqueIdentifier;
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜