2016-09-19 84 views
-1

更新我的Xcode後,我在backendless的find中收到錯誤語法例如Swift 3語法錯誤(Backendless)

dataStore.find(
     { (result: BackendlessCollection!) -> Void in 
      let contacts = result.getCurrentPage() 
      for obj in contacts { 
       print("\(obj)") 
      } 
     }, 
     error: { (fault: Fault!) -> Void in 
      print("Server reported an error: \(fault)") 
    }) 

和錯誤是:Cannot convert value of type '(BackendlessCollection!) -> Void' to expected argument type '((BackendlessCollection?) -> Void)!'

如何解決它??? (!結果:BackendlessCollection)

+0

編譯器建議,以取代'代碼替換 - > Void'用'((結果:BackendlessCollection) - >無效)!' – vadian

+0

哦,好的,告訴我我不知道的事情,我該怎麼做? –

+1

用其他代碼替換代碼有什麼不明之處? – vadian

回答

1

dataStore?.find(
     { (result: BackendlessCollection?) -> Void in 
      let contacts = result?.getCurrentPage() 
      for obj in contacts! { 
       print("\(obj)") 

      } 
     }, 
     error: { (fault: Fault?) -> Void in 
      print("Server reported an error: \(fault)") 
    })