Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getting Current Directory in Objective C

Tags:

I am trying to get current directory, but its giving me path of DEBUG folder, how i can get the path of current directory. I am using the following code.

NSFileManager *filemgr;
NSString *currentpath;

filemgr = [[NSFileManager alloc] init];

currentpath = [filemgr currentDirectoryPath];
like image 270
itsaboutcode Avatar asked Sep 11 '10 20:09

itsaboutcode


1 Answers

currentDirectoryPath returns the current working directory of the program. If you launch it from Xcode in Debug mode, the current directory of the program is the Debug directory.

like image 111
mipadi Avatar answered Oct 29 '22 01:10

mipadi