2012-12-08 1 views
1

UIActionSheet에 문제가 있습니다. 버튼을 클릭하면 충돌이 발생합니다. 나는 NSZombieEnabled을 활성화했다. 그런 다음 다음과 같은 오류 메시지가 나타납니다. 멈출 전에 버튼을 클릭하면 UIActionSheet가 왜 충돌합니까?

 
[FacebookConfigurationController actionSheet:clickedButtonAtIndex:]: message sent to 
deallocated instance 0x84d4430 

나는 나의 방법

-(void) actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger) index 

그러나 충돌에 중단 점을 넣어. 당신이 당신의 FacebookConfigurationController object를 공개 했 당신이 나에게

FacebookConfigurationController.h

@interface FacebookConfigurationController: UIViewController<UIActionSheetDelegate,...> 

FacebookConfigurationController.m

-(void) LaunchFacebookMenu 
{  
    if([Commentaire isEqual:@""]) 
    { 
     NSLog(@"You must enter a comment"); 
    } 
    else 
    { 
     UIActionSheet *action = [[UIActionSheet alloc] initWithTitle: [self getLanguageValue: @"facebook_popup_title"] 
                  delegate: self 
                cancelButtonTitle: nil 
               destructiveButtonTitle: 
           [self getLanguageValue: @"facebook_popup_cancel"] 
                otherButtonTitles: 
           [self getLanguageValue: @"facebook_popup_userwall"], 
           [self getLanguageValue: @"facebook_popup_friendwall"], 
           [self getLanguageValue: @"facebook_popup_deconect"],nil]; 
     action.actionSheetStyle =UIActionSheetStyleBlackTranslucent; 

     [action showInView:m_CurrentView.view]; 
     [action release]; 
    } 
} 




- (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)Index 
{ 
    switch (Index) 
    { 

     case 0: 
     { 
      [m_CurrentView dismissModalViewControllerAnimated:YES]; 
      break; 
     } 
     case 1: 
     { 

     ... 
     ... 
     ... 

답변

1

를 도울 수 있다면 여기 내 코드는 무엇입니까?

당신이 "self"을 해제 때 위임 방법

(void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)Index{} 

곧라고 때문입니다.