Re: Getting the user's name from cocoa
Re: Getting the user's name from cocoa
- Subject: Re: Getting the user's name from cocoa
- From: Chris Kane <email@hidden>
- Date: Tue, 3 Jul 2001 08:34:56 -0600
Well, I would advise:
NSString *yourUserName = NSUserName();
NSLog(@"%@", yourUserName);
Always use a real format string with any methods and functions that take
them (including the ANSI C printf() etc.) rather than some random
string/char pointer you got from somewhere. Especially if you're a
beginner, ALWAYS use a format string even if nothing more than "%s", for
example. You will save yourself trouble later when a user named "
down" or whatever runs the app.
Chris Kane
Cocoa Frameworks, Apple
On Monday, July 2, 2001, at 10:23 PM, Pan wrote:
NSString *yourUserName = NSUserName();
NSLog(yourUserName);
On Monday, July 2, 2001, at 09:51 PM, Steve Woodward wrote:
Could someone post an example of using NSUserName for a beginner?
Thanks in advance...
Sensory Research Network
http://sensoryresearch.com
_______________________________________________
cocoa-dev mailing list
email@hidden
http://www.lists.apple.com/mailman/listinfo/cocoa-dev