I got the url from savePanel sheet, and I would like to do the following:
- Check if it has an extension
- if so remove it
- add custom extension
- If not, add a custom extension
Any easy way to do this. I tried something like the following, but it does not work.
if ( [tmp pathExtension] != @"xxx" ) path = [tmp stringByAppendingFormat:@"xxx"];
OK ... Possible solution as follows
NSString *path; NSURL *filepath; fileurl = [sheet URL]; fileurl = [fileurl URLByDeletingPathExtension]; fileurl = [fileurl URLByAppendingPathExtension:@"yyy"]; path = [fileurl path];
objective-c nsstring nsurl
khalid soofi
source share