0

I am new in Mac OSX and I wanted to get the logged in user for an intranet authentication app I am working on at work. I have read about Rococoa and how it can be used to access native object-c methods and properties. Is there a beginner tutorial or user guide to this? Please help.

2 Answers2

0

Narshion.

You can adapt this C example and call it up from within the Rococoa environment:

#include <stdio.h>
#include <stdlib.h>
int main()
{
printf("test\n");
const char* s = getenv("USER");
printf("USER :%s\n",(s!=NULL)? s : "getenv returned NULL");
printf("end test\n");
}

Regards,

Brainiarc7

Dennis Mungai
  • 1,579
  • 1
  • 15
  • 28
0

You only need to get the environment varriable "USER" with the standard C call getEnv(). (Like on any other OS ;D)

Angel O'Sphere
  • 2,642
  • 20
  • 18