Я пытаюсь показать подкласс UIView с:
-(void)pushChatNewMessage:(id)sender
{
NSNotification *not = (NSNotification *)sender;
NSNumber *num = (NSNumber *)not.object;
OTChatMessageBox *chatMessageBox = [[OTChatMessageBox alloc] init];
chatMessageBox.frame = CGRectMake(123, 60, 778, 208);
chatMessageBox.toId = [num intValue];
[UIView beginAnimations:@"animationChatBox" context:nil];
[UIView setAnimationDuration:0.5];
[UIView setAnimationDelegate:self];
[UIView setAnimationTransition:UIViewAnimationTransitionCurlDown forView:chatMessageBox cache:YES];
[self.view addSubview:chatMessageBox];
[UIView commitAnimations];
[chatMessageBox release];
}
Проблема в том, что я получаю эту ошибку:
modifiying layer that is being finalized
Я заметил в отладке, что метод dealloc объекта OTChatMessageBox просто завершает этот метод.
Если убрать выпуск объекта, все работает нормально ... с большой утечкой ...
Я рассмотрел метод init OTChatMessageBox и он абсолютно прост, только объект textView и кнопка с вызовом уведомления.
Чего мне не хватает?
Заранее спасибо;)
- EDIT -
-(id)init
{
self = [super init];
if (self)
{
self = [[[NSBundle mainBundle] loadNibNamed:@"OTChatMessageBox" owner:self options:nil] objectAtIndex:0];
[txtMessage becomeFirstResponder];
}
return self;
}