There is no problem when running on the simulator, but the notifications are not posting on the devices (iPad 3 and Mini both running iOS 6). If I post the notification myself, the handler gets called. I was wondering if any of you guys have run into this and have any ideas.
Here is the code setting up the handlers:
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(iPadEditSetTitleHandleKeyboardDidShowNotification:) name:UIKeyboardDidShowNotification object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(iPadEditSetTitleHandleKeyboardWillShowNotification:) name:UIKeyboardWillShowNotification object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(iPadEditSetTitleHandleKeyboardWillHideNotification:) name:UIKeyboardWillHideNotification object:nil];
And the definitions of the handlers themselves:
- (void)iPadEditSetTitleHandleKeyboardWillHideNotification:(NSNotification *)notification
- (void)iPadEditSetTitleHandleKeyboardWillShowNotification:(NSNotification *)notification
- (void)iPadEditSetTitleHandleKeyboardDidShowNotification:(NSNotification *)notification
Any help is appreciated.
UPDATE:
Started a new project to get everything out of the way here is the view controller, all of it.
//
// DWViewController.m
// KeyboatdTest
//
// Created by Dan Wesnor on 12/3/12.
// Copyright (c) 2012 Dan Wesnor. All rights reserved.
//
#import "DWViewController.h"
@interface DWViewController ()
@end
@implementation DWViewController
- (void)handleKeyboardNotification:(NSNotification *)notification
{
NSLog(@"%@", notification.name);
}
- (void)viewDidLoad
{
[super viewDidLoad];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(handleKeyboardNotification:) name:UIKeyboardWillShowNotification object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(handleKeyboardNotification:) name:UIKeyboardWillHideNotification object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(handleKeyboardNotification:) name:UIKeyboardDidShowNotification object:nil];
}
- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
@end
The storyboard contains a single text field. Everything else is the standard single-view app template.
Still no joy. Works as it should in the simulator, but not on the iPad itself. Could it be something to do with provisioning or something outside of the code itself?