我试图在方案上与科恰一道创建一套手套。
I ve written an NSString
category and we ve got to the following function:
- (void)createAsFolder
{
NSFileManager *fileManager = [NSFileManager defaultManager];
NSError* err = nil;
[fileManager createDirectoryAtPath:self withIntermediateDirectories:YES attributes:nil error:&err];
if (err)
{
NSLog(@"ERROR : %@",err);
}
}
So, in a few words, let s say we have an NSString* path = @"/some/path/is/here";
, we can create it simply by :
[path createAsFolder];
The thing is, although it works PERFECTLY for normal folders, it does NOT when the path specified is a bundle (that is : WITH an extension). E.g.
NSString* path = @"/this/is/a/path/to/some/bundle.bun";
[path createAsFolder];
以上是NOT的工作。
Any ideas on how to fix that?