我是新來iPad
開發商,找不到文件的下載路徑的目標C
我想提出epub reader
應用,
我要檢查.epub
文件有多少,在它的下載文件夾當用戶從互聯網上下載任何epub
。
,最後我想存儲每個EPUB的名字在我的array
...
我應該如何實現呢?
任何幫助將不勝感激。
在此先感謝!
我是新來iPad
開發商,找不到文件的下載路徑的目標C
我想提出epub reader
應用,
我要檢查.epub
文件有多少,在它的下載文件夾當用戶從互聯網上下載任何epub
。
,最後我想存儲每個EPUB的名字在我的array
...
我應該如何實現呢?
任何幫助將不勝感激。
在此先感謝!
抱歉,該負載DB在這裏,我找到了解決方案,
NSString *files;
NSDirectoryEnumerator *direnum = [[NSFileManager defaultManager] enumeratorAtPath:basePath];
NSMutableArray *movfiles = [NSMutableArray array];
while(files = [direnum nextObject])
{
if([[files pathExtension] isEqualToString:@"epub"])
[movfiles addObject:files];
}
for (int i=0; i<[movfiles count]; i++) {
NSLog(@"array=%@",[movfiles objectAtIndex:i]);
}
我不知道它是幫助你,但嘗試它,我已經在我的應用程序使用,但書籍已添加在我的資源文件夾
NSString *bundleRoot = [[NSBundle mainBundle] bundlePath];
NSFileManager *fm = [NSFileManager defaultManager];
NSArray *dirContents = [fm contentsOfDirectoryAtPath:bundleRoot error:nil];
NSPredicate *fltr = [NSPredicate predicateWithFormat:@"self ENDSWITH '.epub'"];
self.onlyJPGs = [dirContents filteredArrayUsingPredicate:fltr];
如何從我的應用程序打開本地存儲以便將數據粘貼到任何我想要的位置?請回復我 – RealmOfFire
什麼您的下載文件夾意思? –
下載文件存儲在設備中的文件夾的路徑.. – Krunal