diff --git a/Classes/PXAlertView.m b/Classes/PXAlertView.m index 08a7d17..f83b8a8 100644 --- a/Classes/PXAlertView.m +++ b/Classes/PXAlertView.m @@ -221,12 +221,9 @@ - (id)initWithTitle:(NSString *)title [self setupGestures]; - if ((self = [super init])) { - NSNotificationCenter *center = [NSNotificationCenter defaultCenter]; - [center addObserver:self selector:@selector(keyboardWillShown:) name:UIKeyboardWillShowNotification object:nil]; - [center addObserver:self selector:@selector(keyboardWillHide:) name:UIKeyboardWillHideNotification object:nil]; - } - return self; + NSNotificationCenter *center = [NSNotificationCenter defaultCenter]; + [center addObserver:self selector:@selector(keyboardWillShown:) name:UIKeyboardWillShowNotification object:nil]; + [center addObserver:self selector:@selector(keyboardWillHide:) name:UIKeyboardWillHideNotification object:nil]; } return self; }