Hi All,
I am having an issue in iphone when i want to use a custom button in the keypad(text field filler) of my application page. i have embedded a button named dot in the keypad and it is appearing fine but when i click it, it is supposed to go to an action which i defined. but it crashes.
- (void)sendDecimal:(id)sender {
// Post a Notification that the Decimal Key was Pressed.
[[NSNotificationCenter defaultCenter] postNotificationName:@"DecimalPressed" object:nil];
}
it runs till the application tries to send notification to i dont know may be the routine or function or method.
Can somebody help me in this regards.
thanks
EDIT
Here is the error message:
-[UITableView addDecimal:]: unrecognized selector sent to instance 0x4051e00
2010-03-26 16:08:42.272 app[2855:20b]
Terminating app due to uncaught exception 'NSInvalidArgumentException',
reason: '-[UITableView addDecimal:]: unrecognized selector sent to instance
0x4051e00'
EDIT
i have defined the addDecimal selector, here is the code......
- (void)viewDidAppear:(BOOL)animated {
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillShow:) name:UIKeyboardWillShowNotification object:nil];
[[NSNotificationCenter defaultCenter] addObserver:tableView selector:@selector(addDecimal:) name:@"DecimalPressed" object:nil];
Edit
Yes i have written this as [dot addTarget:self action:@selector(sendDecimal:) forControlEvents:UIControlEventTouchUpInside];