How do I get the current working directory's absolute path on the iPhone using Objective-C?
A:
I'm afraid that you can't get the absolute path on device, at least with official SDK. Please make me correct if I'm wrong.
taskinoor
2010-08-30 11:44:36
A:
Not sure whether this works on iPhone, but it should.
char *buf = getwd();
NSString *cwd = [NSString stringWithCString:buf encoding:NSUnicodeStringEncoding];
free(buf);
You might need to fiddle with the right encoding...
EDIT: aaaehm, you might also just want to try NSFileManager's currentDirectoryPath
method...
Max Seelemann
2010-08-30 12:30:11