0

MBProgress HUD을 사용하고 있는데 어떤 문제인지 잘 모릅니다. HUD을 표시하는 UIButton이 있습니다. 이 내 코드는 다음 UIButton을 클릭하면내 코드가 잘못되었습니다. MBProgressHUD를 사용하고 있습니다.

2010-06-11 17:55:26.255 Dual Search[14166:207] * -[MBProgressHUD setCustomView:]: 
unrecognized selector sent to instance 0x6321220 2010-06-11 17:55:26.256 Dual 
Search[14166:207] Terminating app due to uncaught exception 
'NSInvalidArgumentException', reason: '** -[MBProgressHUD setCustomView:]: 
unrecognized selector sent to instance 0x6321220' 2010-06-11 17:55:26.256 Dual 
Search[14166:207] Stack: (41853515, 2505499913, 42125115, 41587990, 41584658, 
13036, 2853830, 3324117, 3332879, 3328066, 2977128, 2871789, 2903111, 49860988, 
41394236, 41390152, 49854621, 49854818, 2895329, 10508, 10362) 

내 앱이 항상 충돌 :

여기
- (void)showHUD:(id)sender { 
    HUD = [[MBProgressHUD alloc] initWithView:self.view]; 
    HUD.mode = MBProgressHUDModeCustomView; 
    [self.view addSubview:HUD]; 
    HUD.delegate = self; 
    HUD.labelText = @"No Internet Connection..."; 
    HUD.opacity = 0.7; 
    HUD.customView = 
    [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"image.png"]]; 
    [HUD showWhileExecuting:@selector(hudWasHidden) 
        onTarget:self 
       withObject:nil 
        animated:YES]; 
} 


- (void)hudWasHidden { 

    float progress = 0.0f; 
    while (progress < 1.0f) { 
     progress += 0.01f; 
     HUD.progress = progress; 
     usleep(50000); 
    } 
} 

은 콘솔 로그입니다.

감사

+0

일반적으로 콘솔이 충돌하거나 디버깅하는 이유를 살펴보십시오. –

+0

충돌이 무엇입니까? –

+0

콘솔에 다음 오류가 표시됩니다. - [MBProgressHUD setCustomView :] : 인식 할 수없는 선택기가 인스턴스로 전송 됨 0x6321220 2010-06-11 17:55:26.256 이중 검색 [14166 : 207] –

답변

0

이 코코아 코드에서 공통의 충돌이다는 "인식 할 수없는 선택기"이 경우 매우 명시 적이다. MBProgressHUD에 customView 속성이 없으며이를 설정하려고 시도하면 충돌이 발생합니다. setCustomView은 여기에서 호출되는 암시 적 선택기 (메서드)이며, 호출 된 메서드가 없으면 Objective-C가 충돌합니다.

수행하려는 작업을 수행하는 방법에 대해 알려줄 내용이 확실하지 않습니다.

관련 문제