У меня есть URL с andress моего pdf файла на iPad Storage:
/Library/Application%20Support/iPhone%20Simulator/5.0/Applications/78AB0683-5B3F-4AD6-83BB-236D9623574B/Library/Caches/Newsstand/953C71E3-CED3-4369-993F-9132119269EC/
Затем у меня есть функция, которая помещает этот andress в NSURL:
-(void)readIssue:(Issue *)issue {
urlOfReadingIssue=[[issue contentURL] URLByAppendingPathComponent:@"magazine.pdf"];
вышеэтот код, у меня есть код де VFR-Reader, чтобы загрузить этот файл с этого URL.Исходный код из Reader Demo:
NSString *phrase = nil; // Document password (for unlocking most encrypted PDF files)
NSArray *pdfs = [[NSBundle mainBundle] pathsForResourcesOfType:@"pdf" inDirectory:nil];
NSString *filePath = [pdfs lastObject]; assert(filePath != nil); // Path to last PDF file
ReaderDocument *document = [ReaderDocument withDocumentFilePath:filePath password:phrase];
if (document != nil) // Must have a valid ReaderDocument object in order to proceed with things
{
ReaderViewController *readerViewController = [[ReaderViewController alloc] initWithReaderDocument:document];
readerViewController.delegate = self; // Set the ReaderViewController delegate to self
if (DEMO_VIEW_CONTROLLER_PUSH == TRUE)
[self.navigationController pushViewController:readerViewController animated:YES];
#else // present in a modal view controller
readerViewController.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
readerViewController.modalPresentationStyle = UIModalPresentationFullScreen;
[self presentModalViewController:readerViewController animated:YES];
#endif // DEMO_VIEW_CONTROLLER_PUSH
[readerViewController release]; // Release the ReaderViewController
}
Мой окончательный код:
-(void)readIssue:(Issue *)issue {
urlOfReadingIssue=[[issue contentURL] URLByAppendingPathComponent:@"magazine.pdf"];
NSString *phrase = nil; // Document password (for unlocking most encrypted PDF files)
NSString *filePath = urlOfReadingIssue;
ReaderDocument *document = [ReaderDocument withDocumentFilePath:filePath
password:phrase];
if (document != nil) // Must have a valid ReaderDocument object in order to proceed with things
{
ReaderViewController *readerViewController = [[ReaderViewController alloc] initWithReaderDocument:document];
readerViewController.delegate = self; // Set the ReaderViewController delegate to self
#if (DEMO_VIEW_CONTROLLER_PUSH == TRUE)
[self.navigationController pushViewController:readerViewController animated:YES];
#else // present in a modal view controller
readerViewController.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
readerViewController.modalPresentationStyle = UIModalPresentationFullScreen;
[self presentModalViewController:readerViewController animated:YES];
#endif // DEMO_VIEW_CONTROLLER_PUSH
[readerViewController release]; // Release the ReaderViewController
}
Но при сборке я получаю сообщение об ошибке "SIGABIT" в AppDelegate.m на @autoreleasepool:
int main(int argc, char *argv[])
{
@autoreleasepool {
return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
}
}
Я не вижу, что здесь происходит.Ища в гугле, я прочитал об этой ошибке.«SIGABRT», похоже, является ошибкой из xcode.
Я занимаюсь этим часами, я ценю, если кто-то с большим опытом работы с VFR-Reader сможет лучше всего подсказать мне об этой ошибке.