im getting the SIGABRT error each time i build. Im seeing the reason below:
Terminating app due to uncaught exception ‘NSUnknownKeyException’, reason: ‘[ setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key numberEntered.’
-(IBAction)numberEntered:(id)sender
{
NSNumber *day=[NSString stringWithFormat:@"@%", dayEntry];
NSLog(@"%@", day);
}
I assume its something to do with me trying to pass the wrong value to *day, but i cant see what the issue is (no errors in xCode).
Essentially all i want to do is to retrieve a Numerical value from a textfield and set it do a variable (day) so i can use it in a calculation. I have added the NSLog in order to ensure im acquiring the correct data from my textfield.
Thanks in advance!
Make sure your custom class implementation implementing
numberEntered:(subclassedUIView/UIViewController/UITextFIeldor whatnot) is actually selected within the InterfaceBuilder under Custom Class, Class.For the sake of this example, I am assuming it is a
UIViewControllerbased class and you call itMyViewController. In that sense, you will need to enter that name under the mentioned IB when observing the “File’s Owner”.For validating if this actually was your problem, you could add something to your
viewDidLoadmethod that prints something into the console. Before being able to do so, you would have to remove that custom method from the event (as that baby would trigger the exception). If that something does not appear when showing the view of that viewController, you know that you have the described issue.See this: