Skip navigation.
 
mlNSNetService gotcha
FROM : Chris Hanson
DATE : Sat Jan 18 21:36:12 2003

(Cross-posting from my weblog
<http://www.livejournal.com/users/chanson/> in hopes of saving people
some debugging time.)

If you're using NSNetService to publish a service via Rendezvous,
don't use the following code to stop the service:

  [myService stop];
  [myService release];
  myService = nil;

You'll fail miserably with a bus error inside of Rendezvous, with no
direct evidence why it happened.

It turns out that there's teardown that's still happening after -stop
returns.  So you need to set a delegate for your service, and release
& nil out the service in the delegate method -netServiceDidStop:.

The PictureSharing sample does, of course do it the right way.  I was
just skimming the documentation and coding away...

  -- Chris

--
Chris Hanson, bDistributed.com, Inc.  |  Email: <email_removed>
Custom Application Development        |  Phone: +1-847-372-3955
http://bdistributed.com/              |  Fax:  +1-847-589-3738
http://bdistributed.com/Articles/    |  Personal Email: <email_removed>
_______________________________________________
cocoa-dev mailing list | <email_removed>
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

Related mailsAuthorDate
No related mails found.