I have character boxes made of my UINavigatableTextField. After each input, responder character should succeed to it's successor. Weirdly, during input of first character, if user enters character 'Q' each time different exception like;
- EXC_BAD_ACCESS, or
- 2012-09-04 14:42:42.600 Kelime Oyunu[6350:707] -[WebScriptObjectPrivate isForShortcutConversion]: unrecognized selector sent to instance 0x21b870 2012-09-04 14:42:42.606 Kelime Oyunu[6350:707] * Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[WebScriptObjectPrivate isForShortcutConversion]: unrecognized selector sent to instance 0x21b870'
is thrown. My code receiving exception below, the [next becomeFirstResponder] line
- (void) moveToNextCharacter: (MBNavigatableTextField *) character
{
dispatch_async(dispatch_get_current_queue(),
^{
UIControl *next = [character nextField];
if(next == nil)
{
[character endEditing:YES];
}
else if ([next isKindOfClass:[UIButton class]])
{
[next sendActionsForControlEvents: UIControlEventTouchUpInside];
}
else
{
[next becomeFirstResponder];
}
});
}
How can i solve the problem? Thanks in advance.
Edit 1: Found a zombie [next resignFirstResponder] (Thanks to @PhillipMills)
Edit 2: It turns out my problem caused from
- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string
{
// Something done here...
// code block of evil zombie summoner
[textField setText:@"Some text"];
// Something else done here
}
Profile->Instruments->Zombies stating that during setText: some object is released (which is previous string i guess).
I am still unable to solve the problem. My goal is updating textField above with new user input (replacementString:).