错误显示:调用中有额外的参数'progressBlock'。
怎么了?

pin.saveInBackgroundWithBlock({(success, error) -> Void in
    if success == false {
        ...
     } else {
          ...
      }

  },
    progressBlock: { (amountDone: CInt) -> Void in
        var percent = Float(amountDone)
        elf.progressIndicatorView.progress = CGFloat(percent)/100

        self.progressIndicatorView.reveal()

  })

最佳答案

尝试:

 pin.saveInBackgroundWithBlock({ (succeeded: Bool, error: NSError?) -> Void in
    // Handle success or failure here ...
    if succeeded {
        println("Save successful")
    } else {
        println("Save unsuccessful: \(error?.userInfo)")
    }

    }, progressBlock: { (amountDone: Int32) -> Void in
          var percent = Float(amountDone)
          self.progressIndicatorView.progress = CGFloat(percent)/100
          self.progressIndicatorView.reveal()
})

关于swift - Swift Parse progressBlock:调用中需要额外的参数,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/30935081/

10-10 07:08