阅读背景:

NSNetService可以正常工作,但是不能得到主机名,解析会导致错误。

来源:互联网 

I'm using Bonjour with an NSNetService to publish a server from my iPhone. It all works as expected, I can browse the pages I'm serving etc. However, on the iPhone I want to display the host name (i.e. the URL, like "myDevice.local."), so that one can also enter the address manually in a browser (useful for clients missing a bonjour discovery service). My understanding is that calling the method [myNetService hostName] should give me that address. However, this call always returns nil. I read on some forum that I first should resolve the service, however both [myNetService resolve] and [myNetService resolveWithTimeout:10] call the delegate method I'm using Bonjour with an NSNetService to publi




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: