Ali*_*Ali 2 iphone xcode objective-c
我用下面的文件目录创建文件夹,我的问题是,如何隐藏这个文件夹,这样当我允许itune共享这个文件夹时不会出现给用户
/*创建新目录*/NSFileManager*filemgr; NSArray*dirPaths; NSString*docsDir; NSString*newDir;
filemgr =[NSFileManager defaultManager];
dirPaths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,
NSUserDomainMask, YES);
docsDir = [dirPaths objectAtIndex:0];
newDir = [docsDir stringByAppendingPathComponent:@"Patients"];
NSLog(newDir);
if(! [self SearchForDirectory:newDir] )
{
NSLog(@"directory Not Exists");
if ([filemgr createDirectoryAtPath:newDir withIntermediateDirectories:YES attributes:nil error: NULL] == NO)
{
NSLog(@"Failed to create directory");
}
}
else{
NSLog(@"directory Exists");
}
[filemgr release];
Run Code Online (Sandbox Code Playgroud)