• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
NSNetServiceBrowser and PictureSharing Browser
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.
  • Prev by Date: Re: Broken Nib
  • Next by Date: Re: Sound Level
  • Previous by thread: Re: Launching other (GUI) applications
  • Next by thread: Re: NSNetServiceBrowser and PictureSharing Browser
  • Index(es):
    • Date
    • Thread