Skip navigation.
 
mlRe: Re: Get Machine Type string
FROM : Shawn Erickson
DATE : Fri Jul 28 23:18:28 2006

On 7/28/06, Shaun Wexler <<email_removed>> wrote:
> On Jul 28, 2006, at 7:51 AM, matt jaffa wrote:
>
> > Is there any cocoa api or other api that can get what type of machine
> > it is. i.e. MacBook Pro, Powerbook, etc. I can easily get the machine
> > model like MacBookPro1,1.
>
> IOKit is your friend.  Use it.  ;)


Likely simpler to use sysctl or sysctlbyname (man 3 sysctl) and ask
for "hw.model". Also that is a more stable API then the IOKit registry
(nothing really ensures that the keys and layout of the IOKit registry
wont change).

-Shawn

Related mailsAuthorDate
mlGet Machine Type string matt jaffa Jul 28, 16:51
mlRe: Get Machine Type string Shawn Erickson Jul 28, 16:52
mlRe: Get Machine Type string Shawn Erickson Jul 28, 16:58
mlRe: Get Machine Type string matt jaffa Jul 28, 17:53
mlRe: Get Machine Type string Michael Watson Jul 28, 18:17
mlRe: Get Machine Type string Chris Vetter Jul 28, 18:27
mlRe: Get Machine Type string Shaun Wexler Jul 28, 22:58
mlRe: Get Machine Type string Shaun Wexler Jul 28, 23:06
mlRe: Re: Get Machine Type string Shawn Erickson Jul 28, 23:18
mlRe: Get Machine Type string Shaun Wexler Jul 29, 23:14