Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I save files to $(PROJECT_DIR) from objective-c code?

Tags:

xcode

I have code which generates resources which I want to save in a subdirectory of my $(PROJECT_DIR). How do I get the real path from this environment variable in code?

like image 433
Tycho Pandelaar Avatar asked Feb 25 '23 03:02

Tycho Pandelaar


1 Answers

open the projects build settings and add SAVEPATH=@\"$(PROJECT_DIR)\" to the preprocessor macros.
Then you can get the project directory like this:

NSString *projectDir = SAVEPATH;
like image 192
Matthias Bauch Avatar answered May 19 '23 02:05

Matthias Bauch