Yesterday, my app ran fine on the simulator. I added a background image to the XIB, and tweaked the location some of my controls. Now when I try to run it, it crashes with:
2012-10-20 21:54:00.280 RIng It Up Scorer[580:11303] * Terminating app due to uncaught exception ‘NSUnknownKeyException’, reason: ‘[ setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key autoBlue1Col.’
* First throw call stack:
(0x1ca6012 0x10e3e7e 0x1d2efb1 0xb90711 0xb11ec8 0xb119b7 0xb3c428 0x2480cc 0x10f7663 0x1ca145a 0x246bcf 0x24898d 0x2aceb 0x2b002 0x29ed6 0x3b315 0x3c24b 0x2dcf8 0x1c01df9 0x1c01ad0 0x1c1bbf5 0x1c1b962 0x1c4cbb6 0x1c4bf44 0x1c4be1b 0x297da 0x2b65c 0x1ced 0x1c15)
libc++abi.dylib: terminate called throwing an exception
autoBlueCol1 is an instance of a subclass of uiTextField. I have 4 textfields of the class, and the one it crashes on should be the 3rd one it creates.
The subclass is:
#import "SPRalphaTextField.h"
@implementation SPRalphaTextField
-(void)awakeFromNib
{
[super awakeFromNib];
self.delegate = self;
}
-(BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string
{
if([string length]==0)
{
return YES;
}
if ([[textField text] length] + [string length] - range.length > 1)
{
return NO;
}
/* limit to only ABC characters */
NSCharacterSet *myCharSet = [NSCharacterSet characterSetWithCharactersInString:@"abcABC"];
for (int i = 0; i < [string length]; i++)
{
unichar c = [string characterAtIndex:i];
if ([myCharSet characterIsMember:c])
{
return YES;
}
}
return NO;
}
@end
This should be a simple program. I only have one view. I have 3 different subclasses, but those are all textboxes. I’m sure I probably need to add more code to this. Just let me know what would help, and I’ll add it.
I figured out that I created this problem by trying to solve a different one. I set the main interface in the application properties. I did that because the app was hanging on the loading screen, so I thought that was that issue. I’m going to create a new question with that problem.