2016-11-08 26 views

回答

0

在我的情況下,我用了'進口Alamofire'。註釋導入,構建,然後取消註釋導入。然後重試編譯。

+0

清理。然後編譯。某些時候成功.. – Ososoi

+0

是的,對我來說,這個竅門也行得通,但我也必須評論Alamfire代碼,然後取消註釋。 (因爲它必須成功編譯)。 對我來說,當我第二天關閉並打開項目時,問題就開始了。 有人解釋我爲什麼會發生? – Vinod

1

我找到了。

Request.swift >>

NotificationCenter.default.post(
     //name: Notification.Name.Task.DidSuspend, 
     name: Notification.Name(rawValue: "org.alamofire.notification.name.task.didSuspend"), 
     object: self, 
     //userInfo: [Notification.Keys.Tasks: task] 
     userInfo: ["org.alamofire.notification.key.task": task] 
    ) 

    NotificationCenter.default.post(
     //name: Notification.Name.Task.DidCancel, 
     name: Notification.Name(rawValue: "org.alamofire.notification.name.task.didCancel"), 
     object: self, 
     //userInfo: [Notification.Keys.Tasks: task] 
     userInfo: ["org.alamofire.notification.key.task": task] 
    ) 

SessionDelegate.swift >>

 NotificationCenter.default.post(
      //name: Notification.Name.Task.DidComplete, 
      name: Notification.Name(rawValue: "org.alamofire.notification.name.task.didComplete"), 
      object: strongSelf, 
      //userInfo: [Notification.Keys.Tasks: task] 
      userInfo: ["org.alamofire.notification.key.task": task] 
     ) 

編輯另一個相同的代碼。也許4〜5個功能。

好運