path of the directory where ibooks's pdf stored ios -
i need existing pdf files in device , upload selected pdf server. i've added 1 pdf file ibooks , tried searching file in directory using code:
nsarray *paths = nssearchpathfordirectoriesindomains(nsdocumentdirectory, nsuserdomainmask, yes); nsstring *documentsdirectory = [paths objectatindex:0]; nsfilemanager *filemanager = [nsfilemanager defaultmanager]; //nserror *error = nil; nsarray *filesatpath = [filemanager contentsofdirectoryatpath:documentsdirectory error:nil]; nslog(@"filesatpath:%@",filesatpath); (nsstring *path in filesatpath) { nslog(@"add.."); if ([path rangeofstring:@".pdf"].length > 0) { //do whatever want pdf file nslog(@"pdf: %@",path); } }
but log shows empty array, please tell me, there other method pdf list in device , select 1 upload in server.
Comments
Post a Comment