如何将 *.pdf 所有 pdf 从我的 iphone 导入到我的应用程序,就像这样添加音乐文件。 http://developer.apple.com/library/ios/#samplecode/AddMusic/Introduction/Intro.html .提前致谢。iphone dev 的新手。非常感谢任何帮助。
NSString *bundlePath = [[NSBundle mainBundle] resourcePath];
NSFileManager *mgr = [[NSFileManager alloc] init];
NSArray *allFiles = [mgr contentsOfDirectoryAtPath:bundlePath error:NULL];
for (NSString *fileName in allFiles)
{
if ([[fileName pathExtension] isEqualToString:@"pdf"])
{
NSString *fullFilePath = [bundlePath stringByAppendingPathComponent:fileName];
// fullFilePath now contains the path to your pdf file
// DoSomethingWithFile(fullFilePath);
NSLog(@"file: %@",fullFilePath);
}
}
NSURL *url = [[NSBundle mainBundle] URLForResource:@"" withExtension: @"pdf"];
NSLog(@"File: %@",url);
最佳答案
您可以将 pdf 文件作为附件通过电子邮件发送,iphone 可以自行阅读。该功能已经存在于 iPhone 的 iOS 中,或者您可以将它们上传到某个地方(在您的服务器上)并发送链接。
关于iphone - 将 *.pdf 导入我的应用程序 iphone,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13855923/