Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

194
Views
Referencia ambigua a la ejecución asíncrona del miembro en el bloque de finalización AWS S3 Swift 3

Al intentar utilizar AWSTransferutility para cargar fotos con Swift, aparece este error. Referencia ambigua al miembro asíncrono (ejecutar:) Busqué preguntas similares pero no encontré la solución.

 func uploadS3Background (dict: NSMutableDictionary) { let transferUtility = AWSS3TransferUtility.default() let expression = AWSS3TransferUtilityUploadExpression() let completionHandler = { (task, error) -> Void in DispatchQueue.main.async(execute: { }) } transferUtility.uploadFile(URL(fileURLWithPath: dict.object(forKey: "url") as! String), bucket: "bucketname/images", key: (dict.object(forKey: "filename") as! String), contentType: "image/png", expression: expression, completionHandler).continueWith { (task) -> AnyObject! in if let error = task.error { print("Error: \(error.localizedDescription)") } if let _ = task.result { // Do something with uploadTask. } return nil; } }

Fuera de un bloque de finalización, no obtengo el error de despacho en la cola principal.

ingrese la descripción de la imagen aquí

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Declare esto en su controlador de vista -

 var completionHandler: AWSS3TransferUtilityUploadCompletionHandlerBlock?

y luego usar

 self.completionHandler = { (task, error) -> Void in DispatchQueue.main.async(execute: { }) }
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!