• 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
Re: API for fetching the computer name in cocoa
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: API for fetching the computer name in cocoa


  • Subject: Re: API for fetching the computer name in cocoa
  • From: Michael Ash <email@hidden>
  • Date: Fri, 12 Jun 2009 13:05:21 -0400

On Fri, Jun 12, 2009 at 12:44 PM, Eric Schlegel<email@hidden> wrote:
>
> On Jun 12, 2009, at 7:14 AM, Adam R. Maxwell wrote:
>
>> There is also NSHost, which has -name and -names.
>
> However, be aware that [[NSHost currentHost] name] can block for an
> exceedingly long time, so if you use it, always call it on a thread; and
> some of other API recommended here, such as SCDynamicStoreCopyComputerName,
> is probably a better choice.

NSHost is documented as not being thread safe, so you must never call
it on a thread.

You're right as well, of course, which means that the logical
conclusion is that you must never use it at all, ever.

Mike
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Re: API for fetching the computer name in cocoa (From: "Gerriet M. Denkmann" <email@hidden>)
 >Re: API for fetching the computer name in cocoa (From: Graham Cox <email@hidden>)
 >Re: API for fetching the computer name in cocoa (From: Tito Ciuro <email@hidden>)
 >Re: API for fetching the computer name in cocoa (From: "Gerriet M. Denkmann" <email@hidden>)
 >Re: API for fetching the computer name in cocoa (From: "Adam R. Maxwell" <email@hidden>)
 >Re: API for fetching the computer name in cocoa (From: Eric Schlegel <email@hidden>)

  • Prev by Date: Re: Questions on using using modal sheets with Core Data
  • Next by Date: Re: Delayed Framework Loading
  • Previous by thread: Re: API for fetching the computer name in cocoa
  • Next by thread: Re: API for fetching the computer name in cocoa
  • Index(es):
    • Date
    • Thread