'NSUnknownKeyException' occured, but I can't find wrong connection - ios

I upgrade my iphone's ios ver to 10.0 and xcode's ver to 8.0(beta).
Source code well done in xcode ver 7.3.1.
but, when i run code in xcode 8.0,
*** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[ setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key idTextField.'
show up.
there is no '!' mark in xib. how can i fix it?
xib image
#interface TutorialViewController () <UIScrollViewDelegate>
{
IBOutlet UIScrollView *tutorialScrollView;
IBOutlet UIPageControl *pageControl;
IBOutlet UIButton *showTermsButton;
IBOutlet UIButton *showPrivacyPolicyButton;
ContactsManager *contactsManager;
IBOutlet UITextField *idTextField;
IBOutlet UITextField *pwTextField;
}
-(IBAction)showTerms:(id)sender;
-(IBAction)showPrivacyPolicy:(id)sender;
-(IBAction)start:(id)sender;
-(IBAction)startWithFacebook:(id)sender;
-(IBAction)goToSignUpPage:(id)sender;
#end
#implementation TutorialViewController

Related

XCode 7 Date picker cause crash of application

Hi I need to integrate date picker with inputView, I am on Xcode7. Using below code the application cause exception. The exception happening while I am touching UITextField element.
Here is the relevant part of the code where the date picker used.
#property (weak, nonatomic) IBOutlet UIDatePicker *graphDate;
#property (weak, nonatomic) IBOutlet UITextField *fromdate;
#property (weak, nonatomic) IBOutlet UITextField *toDate;
............................................................
..............................................................
[_graphDate setDatePickerMode:UIDatePickerModeDateAndTime];
............................................................
..............................................................
[_graphDate setHidden:TRUE];
[_graphDate setFrame:CGRectMake(600, 600, 400, 162)];
_toDate.inputView = _graphDate;
_fromdate.inputView = _graphDate;
_graphDate.date = [NSDate date];
The exception message,
Terminating app due to uncaught exception 'UIViewControllerHierarchyInconsistency', reason:
'child view controller:<UICompatibilityInputViewController: 0x80286850>
should have parent view controller:<VALiveViewController: 0x7cbeda00>
but requested parent is:<UIInputWindowController: 0x7cc25a00>'
I already refereed the answer here UIViewControllerHierarchyInconsistency in 64 bit iOS device but no idea how to apply here, I am newbie in IOS.
Any help will be appreciated.
Thanks,
Haris

Xcode 6.2 iOS target 6.1: self.view endEditing:YES throws exception unrecognized selector sent to instance

I have a textField that pulls up a decimal pad keyboard.
I added a tap gesture recognizer in my .xib and I want to close the keyboard when anyone taps on the screen.
#property (weak, nonatomic) IBOutlet UITextField *billTextField;
- (IBAction)onTap:(id)sender;
#end
#implementation TipViewController
- (IBAction)onTap:(id)sender {
self.title = #"Tap detected";
[self.view endEditing:YES];
}
#end
This throws the following exception:
[TipViewController billTextField:]: unrecognized selector sent to instance 0x7fd6dac50630
2015-03-28 22:19:59.747 TipCalculator[32959:3666939] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[TipViewController billTextField:]: unrecognized selector sent to instance 0x7fd6dac50630'
What am I missing here?

UICollectionView, UICollectionCell and IBOutlet

I have two separate xib. One hold main screen as child of UIView and also UICollectionView. Second xib contains UICollectionCell. If I just run my code as it is, it is working. (First xib with UIView is used in storyboard, its places in UIViewController).
I have this in - (void) awakeFromNib
UINib *cellNib = [UINib nibWithNibName:#"ViewCellNIB" bundle:nil];
[self.todayScroll registerNib:cellNib forCellWithReuseIdentifier:#"TodayCellID"];
Now, I want to add some IBOutlet connections into ViewCellNIB. If I do this, my code crash in runtime with this error:
*** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<NSObject 0xb068b10> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key temporaryLabel.'
I have this:
#property (weak, nonatomic) IBOutlet UILabel *temporaryLabel;
connected to UILabel on UICollectionViewCell
How can I repair this ?
Ok.. I have found solution. My mistake. I have incorrectly connect IBOutlet in Designer. I have to connect outlets via main UICollectionViewCell and not directly by dragging connection from element to code.

This class is not key value coding-compliant for the key Picker

I added a view to my app that I open from a button and can't find what I'm doing wrong.
I triple checked that dataSource & delegate are connected to File's Owner
*** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<HelpViewController 0xab58980> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key Picker.'
The code in my viewcontroller.h
#interface LanguageSelectionViewController : UIViewController {
IBOutlet UILabel *label;
IBOutlet UIPickerView *Picker;
NSArray *PickerData;
}
#property (retain, nonatomic) IBOutlet UIPickerView *Picker;
#property (retain, nonatomic) NSArray *PickerData;
#end
Anyone got a solution or a tip in the right direction?
Go to your storyboard click the helpviewcontroller (the whole thing so you have a blue outline around the view) now with the utility toolbar (toolbar on the right) click the arrow (the right most icon) you should see a ! mark on one of the connections. Delete that and it should work.

Terminating app due to uncaught exception 'NSUnknownKeyException [duplicate]

This question already has an answer here:
Terminating app due to uncaught exception 'NSUnknownKeyException' - error [duplicate]
(1 answer)
Closed 9 years ago.
I am coding some dummy apps to get an understanding for iOS this one such app is a TODO list. I get the following error when I click the button to add a new task.
2013-06-20 09:56:00.763 SnapTask[2322:11303] Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<SLAddTaskViewController 0x917fb90> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key email.'
First throw call stack:
(0x1c92012 0x10cfe7e 0x1d1afb1 0xb7c711 0xafdec8 0xafd9b7 0xb28428 0x2340cc 0x10e3663 0x1c8d45a 0x232bcf 0xf7e37 0xf8418 0x24634e 0xf8648 0xf8882 0xf8b2a 0x10fef5 0x10ffdb 0x110286 0x110381 0x110eab 0x110fc9 0x10e225 0x126082 0x12613a 0x3050e6 0xd6cba 0xd7ae8 0x304f44 0x3044eb 0x1014f3 0x101777 0x1017b7 0x46cfe2 0x45ead9 0x45eb54 0x10e3705 0x1a920 0x256b24 0x10e3705 0x1a920 0x1a8b8 0xdb671 0xdbbcf 0xdad38 0x4a33f 0x4a552 0x283aa 0x19cf8 0x1beddf9 0x1bedad0 0x1c07bf5 0x1c07962 0x1c38bb6 0x1c37f44 0x1c37e1b 0x1bec7e3 0x1bec668 0x1765c 0x24ad 0x23d5)
libc++abi.dylib: terminate called throwing an exception
(lldb)
I have no idea where to even start, the list stores names emails and etc when adding a task
This is my AddTaskViewController header
#import <UIKit/UIKit.h>
#class TaskListViewController;
#interface AddTaskViewController : UITableViewController
-(IBAction)cancelButtonPressed:(id)sender;
-(IBAction)doneButtonPressed:(id)sender;
#property (nonatomic,strong) IBOutlet UITextView *nameField;
#property (nonatomic,strong) IBOutlet UITextView *emailField;
#property (nonatomic,strong) IBOutlet UITextView *homeField;
#property (nonatomic,strong) IBOutlet UITextView *cellField;
#property (nonatomic,strong) IBOutlet UITextView *addressField;
#property (nonatomic,strong) IBOutlet UITextView *notesField;
#property (nonatomic,strong) IBOutlet UITextView *dateField;
#property (nonatomic,strong) IBOutlet TaskListViewController * taskListViewController;
#end
Thank you I am so confused :(
I think you have changed your IBOutlet Name email to emailField.So you need to reconnect your IBOutlet in your xib.So please click on File's Owners control+left click at that time you will see different color on your connectivity.So reconnect you IBOutlet.
I hope it will be helpful.
Try reconnecting all your UIElements in that class.

Resources