2017-10-15 2 views
0

는 경우이 여기에 스크린 샷 Error Image내가 전화 디렉토리 처리기 확장 스위프트 3 CallKit있는 문제가 내가 내 프로젝트에 추가 한 확장을 가능하게하고 때 오류가 점점 오전

입니다 해결하는 방법을 말해주십시오 다른 세부 정보가 필요하면 나에게 그 (것)들을 제공 할 것이지 질문하십시오.

private func addAllBlockingPhoneNumbers(to context: CXCallDirectoryExtensionContext) { 

    for i in 0...numbers.count - 1 
    { 


    let allPhoneNumbers: [CXCallDirectoryPhoneNumber] = [ numbers[i] ] 
    for phoneNumber in allPhoneNumbers { 
     context.addBlockingEntry(withNextSequentialPhoneNumber: phoneNumber) 
    } 
    } 
} 

----------------------------

override func beginRequest(with context: CXCallDirectoryExtensionContext) { 
     context.delegate = self 


     numbers = DBManager.shared.selectContacts() 
    } 
+0

소스 코드를 확인하는 것이 좋습니다 –

+0

일부 코드를 추가하십시오 @GabrielLidenor –

답변

0

내가 확인 좋을 것 오류 코드는 CXCallDirectoryExtensionContextDelegate입니다. requestFailed 기능이 코드를 넣어 :

func requestFailed(for extensionContext: CXCallDirectoryExtensionContext, withError error: Error) {   
    let errorCode = (error as NSError).code 
    switch errorCode { 
    case CXErrorCodeCallDirectoryManagerError.Code.unknown.rawValue: 
     print("Extension could not be load for an unknown reason.") 
    case CXErrorCodeCallDirectoryManagerError.Code.noExtensionFound.rawValue: 
     print("Could not load extension. Extension not found") 
    case CXErrorCodeCallDirectoryManagerError.Code.loadingInterrupted.rawValue: 
     print("Could not load extension. Extension was interrupted while loading") 
    case CXErrorCodeCallDirectoryManagerError.Code.entriesOutOfOrder.rawValue: 
     print("Could not load extension. Call entries are out of order") 
    case CXErrorCodeCallDirectoryManagerError.Code.duplicateEntries.rawValue: 
     print("Could not load extension. Duplicate entries") 
    case CXErrorCodeCallDirectoryManagerError.Code.maximumEntriesExceeded.rawValue: 
     print("Could not load extension. Maximum entries exceeded") 
    case CXErrorCodeCallDirectoryManagerError.Code.extensionDisabled.rawValue: 
     print("Extension not enabled in Settings") 
    case CXErrorCodeCallDirectoryManagerError.Code.unexpectedIncrementalRemoval.rawValue: 
     print("Unexpected incremental removal") 
    case CXErrorCodeCallDirectoryManagerError.Code.currentlyLoading.rawValue: 
     print("Could not load extension. The extension is currently loading") 
    default: 
     print("Could not load extension.") 
    } 
} 

을 이제 디버그 엑스 코드의 확장을. (See details here.) 설정에서 확장 기능을 사용하려고하면 Xcode는 무엇이 잘못되었는지 설명하는 오류 메시지를 인쇄해야합니다.

1

동일한 문제가 발생하여 대상 디렉토리 빌드 단계에 내 확장을위한 데이터 모델을 추가 할 때 오류 제거와 Call Directory Extension 연결에 성공했습니다.

프로젝트를 선택하고 대상 확장명을 선택한 다음 빌드 단계를 선택하고 소스를 컴파일하려면 +를 선택하십시오.

희망이 도움이됩니다.