NSException 오류가 발생합니다. 주변을 둘러 보았지만 방법을 호출하는 방법이 될 수 있지만 문제를 해결할 수는 없습니다. 초보자이므로 좋은 설명을 매우 좋습니다. 여기 NSException 오류 받기
여기#import "AddListingViewController.h"
@interface AddListingViewController()
@property (weak, nonatomic) IBOutlet UITextField *title;
@property (weak, nonatomic) IBOutlet UITextView *desc;
@property (weak, nonatomic) IBOutlet UITextField *price;
@end
@implementation AddListingViewController
@synthesize manager = _manager;
@synthesize add = _add;
- (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.
self.manager = [[ListingTableViewController alloc] init];
self.add = [[ListingManager alloc] init];
}
- (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");
self.add.listingTitle = self.title.text;
self.add.listingDescription = self.desc.text;
self.add.listingPrice = self.price.text;
[self.manager.listings addObject:self.add];
[self dismissViewControllerAnimated:YES completion:nil];
}
@end
내 AddListingViewController.m이 내 AddListingViewController.h
#import <UIKit/UIKit.h>
#import "ListingTableViewController.h"
#import "ListingManager.h"
@interface AddListingViewController : UIViewController
@property (nonatomic) ListingTableViewController *manager;
@property (nonatomic) ListingManager *add;
@end
입니다 나는 점점 오전 오류가 (나는 그것이 명확하게 여기지만 그렇지라고 확신 문제를 해결하는 방법을 알아야 함)
2014-06-30 21:37:44.825 Wildcat Exchange[1981:180450] Add button tapped
2014-06-30 21:37:44.827 Wildcat Exchange[1981:180450] -[UITextInputTraits text]: unrecognized selector sent to instance 0xc193e90
2014-06-30 21:37:44.831 Wildcat Exchange[1981:180450] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UITextInputTraits text]: unrecognized selector sent to instance 0xc193e90'
객관적인 예외 예외 점을 추가하고 예외를 유발하는 코드 행을 확인하십시오. 가장 좋은 추측은 XIB 파일에 잘못된 연결이있는 것입니다. – bbum