We are migrating issue tracker of Cocos2d-x Project to Github, please create new issue there. Thanks.
EAGLView is not removed from NSNotificationCenter
EAGLView is not removed from NSNotificationCenter
Bug #3066 [Closed]
Redmine issue system is closed, we are using github issue system instead.
This issue was moved to https://github.com/cocos2d/cocos2d-x/issues/8239
Status: | Closed | |
---|---|---|
Start date: | 2013-10-25 | |
Priority: | Low | |
Due date: | ||
Assignee: | - | |
% Done: | 0% |
|
Category: | ios | |
Target version: | - |
The bug appears to be in Apple’s sample code EAGLView. If the view is released then keyboard events crash the process. Fix is simple:
cocos2dx/platform/ios/EAGLView.mm
(void)didMoveToWindow;
{
if (self.window) {
[[NSNotificationCenter defaultCenter] addObserver:self
selector:`selector(onUIKeyboardNotification:)
name:UIKeyboardWillShowNotification object:nil];
name:UIKeyboardDidShowNotification object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:`selector(onUIKeyboardNotification:)
name:UIKeyboardWillHideNotification object:nil];
name:UIKeyboardDidHideNotification object:nil];
} else {
[[NSNotificationCenter defaultCenter] removeObserver:self];
}
}