I am making a somewhat basic ios application and i am trying to have the user click on a cell in a uitableview and then have it open a pdf. I am running into a strange error though. When i click on the cell the app crashes and this is my error
014-01-14 20:15:09.782 CCHA App[1171:60b] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<PDFDetailViewController 0x15680a10> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key pdfView.'
*** First throw call stack:
(0x3000ef4b 0x3a44f6af 0x3000ec61 0x3094e18b 0x3095fdd5 0x2ff7ee6f 0x32ae0f87 0x32a42917 0x328a4389 0x327861bd 0x32786139 0x329123eb 0x32830273 0x3283007d 0x32830015 0x32781da3 0x32408c6b 0x3240447b 0x3240430d 0x32403d1f 0x32403b2f 0x323fd85d 0x2ffda1cd 0x2ffd7b71 0x2ffd7eb3 0x2ff42c27 0x2ff42a0b 0x34c69283 0x327e6049 0x18269 0x3a957ab7)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb)
Here is some of my code!
//
// PDFDetailViewController.h
// CCHA App
//
// Created on 1/14/14.
// Copyright (c) 2014 CCHA. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface PDFDetailViewController : UIViewController {
}
@property (strong, nonatomic) IBOutlet UIWebView *PDFWebView;
@end
//
// PDFDetailViewController.m
// CCHA App
//
// Created on 1/14/14.
// Copyright (c) 2014 CCHA. All rights reserved.
//
#import "PDFDetailViewController.h"
@interface PDFDetailViewController ()
@end
@implementation PDFDetailViewController
@synthesize PDFWebView;
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
// Custom initialization
}
return self;
}
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view.
NSString *path = [[NSBundle mainBundle] pathForResource:@"TestingDoc" ofType:@"pdf"];
NSURL *url = [NSURL fileURLWithPath:path];
NSURLRequest *request = [NSURLRequest requestWithURL:url];
[PDFWebView loadRequest:request];
[PDFWebView setScalesPageToFit:YES];
}
- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
@end
I cant figure out why this is happening and any help would be greatly appreciated. Thank you!!