hi there, i am trying to zip a file into a subfolder in my iphone app.
NSArray *path = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *dir = [path objectAtIndex:0];
NSString *storeunzipfiles = [dir stringByAppendingPathComponent:@"/MyFolder"];
if (![[NSFileManager defaultManager] fileExistsAtPath:storeunzipfiles])
[[NSFileManager defaultManager] createDirectoryAtPath:storeunzipfiles attributes:nil]; //Create folder
ok now i created the folder. What i want to do is to del all the files in the folder before i unzip my file. but i am not getting it.
NSFileManager *filemgr;
filemgr = [NSFileManager defaultManager];
[filemgr removeItemAtPath: @"/MyFolder" handler: nil];
// warning: 'NSFileManager' may not respond to '-removeItemAtPath:handler:'
}
}
lastly, unzip to subfolder.
if ([zip UnzipFileTo:storeunzipfiles overWrite:YES]) {...
ok i got a warning msg...
whats the method to load the files in the subfolder? is this right?
NSString *docpath = [documentsDirectory stringByAppendingPathComponent:@"/MyFolder/Data.plist"]; ?
thks in advance