`relative paths` are relative to the current "working directory" of the application. in most *nix systems, you can find that with the PWD env variable. Theres no special thing to add for relative paths to work; it should be part of the standard libraries. The trick is knowing what your wd is. If you're good at terminal, you can run the program yourself:
the echo line proves that your working directory (ie, current folder) is what it is. if your files aren't opening right (or aren't saving anywhere reasonable), write this into your programs before your open/save calls:
#include <stdio.h> //put these with the rest of your inclues
// put the following right before your relative path attempts
fprintf( stderr, "cwd: %s\n", getenv("PWD") );
theres probably a better way to get the wd, but thats the first off my head. any attempt at a relative path after that call will be relative to what is printed on stderr.
i dont know from what directory xcode runs the programs, but that fprintf line should tell you.