我正在尝试发布通知但没有成功!我可以毫无问题地使用键盘,但现在正在尝试自定义键盘,如下所示:
在我的根视图中,我有这个
。H
-(void) allowEdits:(NSNotification *)notification;
.m
//this section is run in method to present the passcode entry form
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(allowEdits:) name: @"PasscodeOK" object:nil];
PasscodeEntryViewController *vc = [[PasscodeEntryViewController alloc]
init];
[self presentModalViewController: vc animated:YES];
[vc release];
// and this is the response to the notification
-(void) allowEdits:(NSNotification *)notification {
NSLog(@"notification fired");
}
// in the vc instance I have this to notify passcode was ok
[[NSNotificationCenter defaultCenter]
postNotificationName:@"PasscodeOK" object:nil];
[self dismissView];
但是 allowEdits 永远不会被调用?