2016-09-19 5 views
-1

Xcodeを更新した後バックエンドレスの検索でエラーが発生しています。Swift 3構文エラー(バックエンドレス)

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)!'

私はそれを修正することができますか?

+0

でコードを置き換え - 'と> Void'!((結果:?BackendlessCollection) - >ボイド)を ' – vadian

+0

大丈夫ああを教えて私が知りたくないこと、どうすればいいのですか? –

+1

コードを他のコードに置き換えるのには不明な点は何ですか? – vadian

答えて

1

コンパイラは `(結果:BackendlessCollection!)を交換することを提案

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)") 
    })