Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
公開されたサービスを NSNetService クラスから削除するにはどうすればよいですか?
誰でも私にそれをするように言うことができますか?
または、常に一意のデバイス名を取得する必要があります (複数の公開を行った場合)
NSNetService インスタンスは RunLoop でスケジュールされているため、mDNSResponder を介して定期的に Bonjour サービスを公開し、ネットワーク上の他のデバイスにサービスの存在を通知し続けることができます。
RunLoop から NetService を削除するだけでうまくいくはずです。NetService が現在パブリッシュしようとしている場合に備えて、前に -stop を呼び出すことを忘れないでください。