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;
精彩评论