0
我想獲得使用CNContactStore
函數requestAccessForEntityType
的地址簿的授權,但是我得到一個我不明白的錯誤。CNContactStore.requestAccessForEntityType參數問題
的功能是在類定義:
public func requestAccessForEntityType(entityType: CNEntityType, completionHandler: (Bool, NSError?) -> Void)
這是我的代碼:
let addressBookRef: CNContactStore = CNContactStore.requestAccessForEntityType(CNEntityType.Contacts, completionHandler: authorizationHandler)
func authorizationHandler(granted: Bool, error: NSError?) {
}
編譯器錯誤:
Extra argument 'completionHandler' in call