iPhone file special locations

Looks like this needs some attention, since a lot of returned locations are illegal.

For a start:

[code] case currentApplicationFile:
{
const File exe (juce_getExecutableFile());
const File parent (exe.getParentDirectory());

#if JUCE_IOS
return parent;
#else
return parent.getFullPathName().endsWithIgnoreCase (“Contents/MacOS”)
? parent.getParentDirectory().getParentDirectory()
: exe;
#endif
}
[/code]
Since the app is always in a bundle, with no sub directory.

For reference, something like this is the preferred way to get the app’s ‘sandbox’:

[code] NSArray *paths = NSSearchPathForDirectoriesInDomains (NSDocumentDirectory, NSUserDomainMask, YES);

NSString *filePath			= [paths objectAtIndex:0];
NSLog (filePath);

[/code]

That seems to work, although I don’t see why that currentApplicationFile change wouldn’t work too. I didn’t try it on a device yet.

Bruce

Ok, thanks Bruce, I’ll take a look at that…