NSNetServiceBrowser and PictureSharing Browser
NSNetServiceBrowser and PictureSharing Browser
- Subject: NSNetServiceBrowser and PictureSharing Browser
- From: Aidas Dailide <email@hidden>
- Date: Mon, 7 Apr 2003 22:39:29 +0300
Hi,
I want to make a little app with NSNetServiceBrowser, but i got a
little problem. I used example from Apple (PictureSharing Browser), but
it found a problem there. Code bellow helps, but what if all
NSNetService's are using the same name,are same type and using same
domain? Isn't there a better way to know which NSNetServiceBrowser to
remove from array? setProtocolSpecificInformation doesn't seems to help.
Thanks,
Aidas
Code;
- (void)netServiceBrowser:(NSNetServiceBrowser *)aNetServiceBrowser
didRemoveService:(NSNetService *)aNetService
moreComing:(BOOL)moreComing {
// This case is slightly more complicated. We need to find the
object in the list and remove it.
NSEnumerator * enumerator = [services objectEnumerator];
NSNetService * currentNetService;
while(currentNetService = [enumerator nextObject]) {
if([[currentNetService name] isEqual:[aNetService name]] &&
[[currentNetService type] isEqual:[aNetService type]] &&
[[currentNetService domain] isEqual:[aNetService domain]]) {
[services removeObject:currentNetService];
break;
}
}
if(!moreComing) {
[pictureServiceList reloadData];
}
}
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.