Skip to content

Instantly share code, notes, and snippets.

@kosso
Created November 18, 2013 15:38
Show Gist options
  • Save kosso/7529870 to your computer and use it in GitHub Desktop.
Save kosso/7529870 to your computer and use it in GitHub Desktop.
-(NSString*)getNormalizedPath:(NSString*)source
{
// NOTE: File paths may contain URL prefix as of release 1.7 of the SDK
if ([source hasPrefix:@"file:/"]) {
NSURL* url = [NSURL URLWithString:source];
return [url path];
}
// NOTE: Here is where you can perform any other processing needed to
// convert the source path. For example, if you need to handle
// tilde, then add the call to stringByExpandingTildeInPath
return source;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment