I am getting the following errors:
Terminating app due to uncaught exception 'NSUnknownKeyException', reason:
'[<AddListingViewController 0xe603940> setValue:forUndefinedKey:]:
this class is not key value coding-compliant for the key listingDescription.'
by the way, listingDescription is in another class and it looks like this:
@property (nonatomic, strong) NSString *listingDescription;
Here is my AddListingViewController.h
#import <UIKit/UIKit.h>
#import "ListingTableViewController.h"
#import "ListingManager.h"
@interface AddListingViewController : UIViewController
@property (nonatomic) ListingManager *manager;
@end
Here is the AddListingViewController.m
#import "AddListingViewController.h"
@interface AddListingViewController ()
@property (weak, nonatomic) IBOutlet UITextField *title;
@property (weak, nonatomic) IBOutlet UITextView *description;
@property (weak, nonatomic) IBOutlet UITextField *price;
@end
@implementation AddListingViewController
- (instancetype)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.
}
- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
//cancel posting on tap
- (IBAction)cancelListing:(UIBarButtonItem *)sender {
NSLog(@"cancel tapped thpugh");
[self dismissViewControllerAnimated:YES completion:nil];
}
//add item on tap
- (IBAction)addListing:(UIBarButtonItem *)sender {
NSLog(@"Add button tapped");
}
@end
Not sure why I am getting the error. Whenever I click the bar button "add" to go to the "AddListingViewController" view controller, I get the error. Looked around but their answers didn't satisfy my needs.