Solution here: How do I save files to $(PROJECT_DIR) from objective-c code?
My Xcode project is in:
/Users/MyUserName/Desktop/TheProject
I have some Objective-C code that writes a file here. Unfortunately this hard-coded path doesn't work on my co-worker's machine. He has the project in another directory like so:
/Users/AnotherUserName/Desktop/More/Folders/TheProject
I want to write the file to something like:
ProjectRootDir/
where I find that directory programmatically with iOS and Objective-C. How can I do that?
I looked around for an equivalent to $(SRCROOT)
that's used in the project's build settings but I didn't find anything.
More info:
// currently trying this but it doesn't get me close to the project
NSString *path = [NSString stringWithFormat:@"%@/%@.plist",
documentsDirectory,
fileName];
I want to replace documentsDirectory
with a path to the Xcode project on the local machine.