I am moving a file to a folder ( file is stored in other folder), I am moving it by giving the file name, but I want to move all files, which r stored in a folder to some other folder.
How can I do this ? Thanks in advance.-(void)MoveFilesToMyInBoxFolder:(NSString *)destfileName
{
NSString* fullPath = [[NSBundle mainBundle] pathForResource:[destfileName stringByDeletingPathExtension] ofType:@"xml"];
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
if (!documentsDirec开发者_JS百科tory) {
NSLog(@"ERROR:Documents directory not found!");
return;
}
i am calling this method like
[self MoveFilesToMyInBoxFolder:@"QS-H02032011100717AM1.xml"];
Using contentsOfDirectoryAtPath
method of NSFileManager
you can get an array of file names of all items within a directory. You can iterate through this array and move each item.
精彩评论