我想下载的EPUB书,并将其保存到我的目录,然后在网页视图打开的书。我知道如何在webview中打开一本书,我不知道如何下载epub书并将其保存到我的文档中。我试图解开链接,但我给我的任何链接只能看到help.epub书。我无法在我的文档中看到我需要的epub书。 用于解链的代码是:下载EPUB图书编程和文档目录保存在Xcode
(void)unzipAndSaveFile{
ZipArchive* za = [[ZipArchive alloc] init];
NSLog(@"url%@",receivedUrl);
NSLog(@"recieved%@",receivedTitle);
if([za UnzipOpenFile:[[NSBundle mainBundle] pathForResource:receivedTitle ofType:@"epub"]]){
NSString *strPath=[NSString stringWithFormat:@"%@/UnzippedEpub",[self applicationDocumentsDirectory]];
//Delete all the previous files
NSFileManager *filemanager=[[NSFileManager alloc] init];
if ([filemanager fileExistsAtPath:strPath]) {
NSError *error;
[filemanager removeItemAtPath:strPath error:&error];
}
[filemanager release];
filemanager=nil;
//start unzip
[za UnzipFileTo:strPath overWrite:YES];
NSLog(@"path%@",strPath);
}
[za release];
}
我已经使用JSON解析的数据。
pathForResource:receivedTitle ---在这里 “receiveTitle” 我是路过的epub的链接。请大家帮我理清这个问题... – iOSDev 2012-01-30 05:32:11