2014-09-21 3 views
13

나는이 코드_UIViewServiceInterfaceErrorDomain

- (IBAction) mailbutton:(id)sender 
{ 

    if([MFMailComposeViewController canSendMail]) 
    { 

     [MSAPP.globalMailComposer setModalTransitionStyle:UIModalTransitionStyleCoverVertical]; 
     [self presentViewController:MSAPP.globalMailComposer animated:YES completion:nil]; 

    } 
    else 
    { 

     UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Error" 
                message:@"Unable to mail. No email on this device?" 
                delegate:self 
              cancelButtonTitle:@"OK" 
              otherButtonTitles:nil]; 
     [alert show]; 
     [MSAPP cycleTheGlobalMailComposer]; 
    } 
} 

답변

3

이 아이폰 OS 8 시뮬레이터 알려진 문제로이 오류를

viewServiceDidTerminateWithError: Error Domain=_UIViewServiceInterfaceErrorDomain Code=3 "The operation couldn’t be completed. (_UIViewServiceInterfaceErrorDomain error 3.)" UserInfo=... {Message=Service Connection Interrupted} 

납니다 MFMailComposeViewController

에 문제가 있어요. 가능한 해결 방법은 this post을 참조하십시오. 이 필요한 때마다

당신은 할당하고 초기 단계에 MFMailComposeViewController을 시작하고, 하나 개의 정적 변수에 고정해야, 정적 MFMailComposeViewController 인스턴스를 얻을 이 존재.

그리고 각 사용 후 글로벌 MFMailComposeViewController를 "순환"시켜야합니다. "동일하게 재사용"하는 것은 신뢰할 수 없습니다. 릴리스하는 글로벌 루틴을 가지고 있고 은 싱글 톤 MFMailComposeViewController를 다시 초기화합니다. 당신이

신용이 게시물에 대한 "Joe Blow"로 이동이 완료 된 후 각 시간을 호출합니다. 코드로 판단하면 이미 글로벌 메일 작성자를 선언 한 것입니다. 게시물이 귀하의 문제를 해결하는지 확인하기 위해 "재활용"해보십시오. 나는 같은 문제가 있고 불행히도이 해결책은 내 문제를 해결하지 못한다. 이 솔루션은 iOS 7.1 시뮬레이터에서 작동하지만 iOS 8에서는 작동하지 않음을 확인할 수 있습니다.하지만 실제 iOS 8 장치에서 작동 할 것이라고 제안되었습니다.