我最近接管了一个 iOS 项目,当我通过单击部分 curl 从我的 PDWViewController 返回到上一个视图时,该项目似乎崩溃了。我收到以下错误:
我很抱歉我能够提供的信息量不足,但因为我最近才开始为 iOS 开发并在不到一周前接管了整个项目。这是我认为相关的内容:
PDFViewController
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view.
itemObjectsInApp =[CoreDataHelper getObjectsForEntity:@"Item" withSortKey:nil andSortAscending:YES andContext:managedObjectContext];
Item *selectedItem = nil;
for(Item *item in itemObjectsInApp){
if(item.isSelectedItem == [NSNumber numberWithInt:1]){
selectedItem = item;
}
}
NSString *path = [[NSBundle mainBundle] pathForResource:selectedItem.pathToPdfFile ofType:@"pdf"];
NSURL *targetURL = [NSURL fileURLWithPath:path];
NSURLRequest *request = [NSURLRequest requestWithURL:targetURL];
[self.pdfView loadRequest:request];
[selectedItem release];
}
主视图控制器
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
PdfViewController *pdfViewController = (PdfViewController *)[segue destinationViewController];
pdfViewController.managedObjectContext = managedObjectContext;
}