• 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: Getting a StringPtr from Gestalt on 64-bit
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Getting a StringPtr from Gestalt on 64-bit


  • Subject: Re: Getting a StringPtr from Gestalt on 64-bit
  • From: David Duncan <email@hidden>
  • Date: Thu, 3 Sep 2009 11:02:59 -0700

On Sep 3, 2009, at 10:56 AM, Scott Lahteine wrote:

CSCopyMachineName() returns the name of the computer as set by the user in the Sharing preference pane, which is not the same thing as the gestaltUserVisibleMachineName. The "Machine Name" I want is the Apple-defined identifier for the type of computer, which (as of this date) begins with one of the following strings:

"AAPL ","iMac ","PowerBook ","PowerMac","RackMac","Macmini","MacPro","MacBookPro","MacBook"

For example, my computer is identified by Gestalt() as a "MacBook2,1"

On the other hand, I see that same string through ioreg on the command line, so perhaps there's a way to get it from the IO Registry?


First the question is "Why do you need to know?" If your basing feature decisions on this info, then you should probably go another route.

But if you must know this for other reasons, the way to get it programmatically is via sysctlbyname using "hw.model".
--
David Duncan
Apple DTS Animation and Printing


_______________________________________________

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: Getting a StringPtr from Gestalt on 64-bit (From: Scott Lahteine <email@hidden>)

  • Prev by Date: NSImage with multiple representation sizes
  • Next by Date: Re: Distinguishing between return and enter in NSTextField
  • Previous by thread: Re: Getting a StringPtr from Gestalt on 64-bit
  • Next by thread: Re: Getting a StringPtr from Gestalt on 64-bit
  • Index(es):
    • Date
    • Thread