In order to copy the file into your .app when it is built, you must add it to a Copy Files build step.
Open your target, go down to Build Steps, and there should be a build step for Copy Files. I think the SDL Xcode template produces one Copy Files step for Resources and another one to copy the frameworks into Frameworks. Since your file is already inside the Resources directory in the bundle, it doesn't look like you have to do this step.
You'll probably need to change the code that Eitsch provided to chdir into the Resources folder of the bundle rather than the root directory of the bundle. That's easy; just change his code to copy the resources URL of the bundle instead of the bundle URL, like so:
- (void) setupWorkingDirectory:(BOOL)shouldChdir{ if (shouldChdir) { char parentdir[MAXPATHLEN]; CFURLRef url = CFBundleCopyResourcesDirectoryURL(CFBundleGetMainBundle()); /* get the resources component instead of the main bundle URL */ if (CFURLGetFileSystemRepresentation(url, true, (UInt8 *)parentdir, MAXPATHLEN)) { /* convert to a path */ assert ( chdir (parentdir) == 0 ); /* chdir to the Resources component of the bundle */ } CFRelease(url); CFRelease(url2); }}
IIRC, this should work. I'm away from my Mac so I can't confirm if this compiles properly, but I've used something similar in the past. Check out the
CFBundle reference documentation for more fun stuff you can do with app bundles.
Also, don't forget that shouldChdir won't be true in this code when you run it from Xcode! You'll have to modify the call to setupWorkingDirectory (in the same file) to pass YES instead of its normal argument.