• 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: How do I access NetInfo from Cocoa?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How do I access NetInfo from Cocoa?


  • Subject: Re: How do I access NetInfo from Cocoa?
  • From: Rainer Brockerhoff <email@hidden>
  • Date: Tue, 9 Oct 2001 14:47:44 -0300

Date: Tue, 9 Oct 2001 09:35:49 -0700
From: Douglas Davidson <email@hidden>

On Monday, October 8, 2001, at 07:01 PM, Josh M. Hurd wrote:

Here is what I came up with:

struct passwd *theUserInfo;
NSString *UID;

theUserInfo = getpwnam([[userName stringValue] cString]);

UID = [[NSNumber numberWithInt:theUserInfo->pw_uid] stringValue];

userName is a user editable TextField.
UID is an NSString because I need it in a pathname.

I would suggest not using the cString method here. Strings at the BSD
level are generally UTF8, so you should probably specify that.

As someone else from Apple pointed out to me, [userName fileSystemRepresentation] would be more orthodox than [userName UTF8String] due to encoding subtleties.


--
Rainer Brockerhoff <email@hidden>
Belo Horizonte, Brazil
"Originality is the art of concealing your sources."
http://www.brockerhoff.net/ (updated Oct. 2001)


  • Prev by Date: RE: DLL hell (was: Cocoa newbie frustration)
  • Next by Date: Re: Problem with TIFF alpha channel
  • Previous by thread: Re: How do I access NetInfo from Cocoa?
  • Next by thread: Another Table View Question
  • Index(es):
    • Date
    • Thread