Reputation: 441
I want to search each and every pdf files on whole iphone.Is it possible in iphone sdk? I have tried following code but it is giving our own application's files.
NSString *bundleRoot = [[NSBundle mainBundle] bundlePath];
NSArray *dirContents = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:bundleRoot error:nil];
NSArray *onlyPDFs = [dirContents filteredArrayUsingPredicate:[NSPredicate predicateWithFormat:@"self ENDSWITH '.pdf'"]];
Upvotes: 2
Views: 208
Reputation: 54415
Each application (and its associated files) are sandboxed under iOS, hence you won't be able to access files other than those produced by your own application.
i.e.: This isn't possible.
Upvotes: 5