0

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 setDelegate:self];

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

Vipin
  • 4,718
  • 12
  • 54
  • 81

1 Answers1

1

You can use unique Device Id for this:

NSString* deviceID = [ UIDevice currentDevice ].uniqueIdentifier;
Arvind
  • 543
  • 1
  • 5
  • 17