0

I'm trying to get my sandboxed mac app to get to the user's real home folder.

This is what I tried

const char *home = getpwent()->pw_dir;
NSString *path = [[NSFileManager defaultManager] 
              stringWithFileSystemRepresentation:home
              length:strlen(home)];
NSURL *url = [NSURL fileURLWithPath:path isDirectory:YES];

But I'm getting this error:

Member reference type 'int' is not a pointer

What am I missing?

dot
  • 2,823
  • 7
  • 38
  • 52

1 Answers1

0

I forgot to

 #include <pwd.h>

I'll leave the question up in case someone else has trouble with it!

dot
  • 2,823
  • 7
  • 38
  • 52