Note that there are some explanatory texts on larger screens.

plurals
  1. USuser298261
    primarykey
    data
    text
    plurals
    1. COThis question is almost 2 years old! To answer the poster's original and follow-up questions: Inside Yannick's reply you'll see the "yourImage" value. That value is supposed to represent the UIImage of your image. So, if you drew an image onto the screen, and captured a screenshot of the image into a UIImageView named "myImageView", you would be referencing the UIImage contained within that ImageView, via "myImageView.image". The UIImage would then be translated/serialized into the binary data (using the method above) which would be appended to your URLRequest. I hope that clarifies things. :)
      singulars
    2. CO^- Commenter above is absolutely right. Your threading code is currently redundant. The logic, sans-queues, is perfectly sound and will execute appropriately. You really only want to rely on threads for blocks that MUST be executed concurrently, or single-file (via a serial queue). Threading the results of the request (which is what you are doing), rather than the request block itself, is an inefficient usage of threads, as you need more speed in "getting" the data rather than "setting" it.
      singulars
    3. COThe error is created because both connections are sharing the same data source. When building applications where specific tasks have to fire concurrently (which you did inadvertently, it seems :) ), you either have to have a unique data source for each connection (One-to-One), or create a semaphore so your mutable data source isn't being serialized with the results of multiple connections at once (race conditions). The end result is the creation of corrupted, or incomplete, data! (Which you experienced).
      singulars
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload