735Tesla
735Tesla

Reputation: 3261

Objective C Full Name to Logon Name

I have a user's full name (like the one returned by NSFullUserName()). Is there any way in c or objective c to confert this to a logon name (like the one returned by NSUserName()).

However, I cannot use NSFullUserName() because the full name I have is not necessarily the name of the currently logged in user.

Upvotes: 0

Views: 184

Answers (1)

rickster
rickster

Reputation: 126177

The login name (NSUserName) and the full/display name (NSFullUserName) have no automated relationship. A user, when creating an account or at any time afterward in System Preferences, can choose whatever they like for both names — so there's no way to generate one given the other and be guaranteed it's correct.

Upvotes: 2

Related Questions