I'm trying to figure out if any methods in NSString, NSURL, or NSFileManager will sanitize a single path component so it can be appended to a fileURL which represents a directory.
The specific usage is a case where the user is saving multiple objects and is allowed to pick/create a directory, which will be populated with files named roughly corresponding to user-entered NSStrings. I'm already prepared to strip prohibited characters, normalize, and append a numbered suffix if some objects have the same sanitized name, but one big problem was forward slash ("/") translation. Is there a method which will interpret a string as a single path component and translate slash to colon so the user-presented filename will look the way the user expects? Some like -[NSURL URLByAppendingPathComponent:] will accept a string representing multiple components separated by slash, so no translation occurs.
There are other issues I'd like the method to handle, like stripping or refusing prohibited characters, Unicode normalization, etc, but they could be handled in other ways (e.g. -decomposedStringWithCanonicalMapping).