I am stuck in an iOS concept that I cannot understand, no matter how much I read about it. I am trying to override the standard iOS number pad with a special design. When a user touches a UITextField, I want the user inputView to appear instead of the standard numeric keypad.
I created a separate ViewHontroller.h / .m / .xib class for my custom View input called "customInputViewController". Right now itโs just a dark background and one button that hides about half the screen when you touch UITextField (similarly on the numeric keypad, but it looks just different). My implementation fails when I click one button in my custom inputView - iOS throws an EXC_BAD_ACCESS error.
This is how I load the .xib file at runtime and attach a custom inputView to a UITextField object:
UIViewController *v = [[customInputViewController alloc] initWithNibName:@"customInputDesign" bundle:nil]; myTextInput.inputView = v.view;
In the user input .Xib file for the View, I set the File Owner as "customInputViewController" and I created a method (IBAction) and bound it to UIButton. When this button is pressed, (IBAction) is configured to send an NSLog message (@ "Clicked"). Nothing special. This is just a simple template implementation that continues to throw an error.
Perhaps I am doing this completely wrong. Can anyone provide a simple example?
source share