Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

5
  • Are you mixing Swift and Objective-C code? If you also write saveFeed in Swift, you can make that async and you will be able to await. Otherwise you'll have to use completion handlers like the old days. Commented Sep 10, 2024 at 0:49
  • I've tidied up the code formatting a bit. I am concerned that you seem to be mixing Objective-C and Swift, so separated the two fragments. There were also unbalanced square brackets and braces in the fragments. Are you sure this is real code? Commented Sep 10, 2024 at 9:50
  • Oh yes, and as @Sweeper says, don't think await is supported on Objective-C. If you have the choice, write everything in Swift. Commented Sep 10, 2024 at 9:54
  • this is an older hybrid app written largely in Objective C with some Swift and this feed feature is in the Objective-C part. However, I thought it might make sense to handle the validate remote file link in a swift extension so it can easily be referenced when needed. @Sweeper I have not succeeded in figuring how to call await from Objective C so perhaps I have to use completion handler but haven't figured out syntax to successfully call from Objc. Commented Sep 10, 2024 at 12:07
  • Posted separate question on error trying to use completionHandler approach here: stackoverflow.com/questions/78969726/… Commented Sep 10, 2024 at 13:29