• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSSharingService with Animated GIFs?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSSharingService with Animated GIFs?


  • Subject: Re: NSSharingService with Animated GIFs?
  • From: Charles Carver <email@hidden>
  • Date: Sat, 17 May 2014 03:16:06 -0400

Ken,

Thanks for the tips! As I’m new to Cocoa, they’re all very helpful.

> You should consider what happens if the server is slow to respond.  The above call will block until the image download is complete.  Better to use the asynchronous URL loading mechanisms in the frameworks (e.g. NSURLSession).

While working on a similar image download method for a different part of my app, I also encountered the blocking nature of writeToURL. I Googled for a solution (not wanting to refactor my saving with NSURLSession), and found an SO question (http://stackoverflow.com/questions/16283652/understanding-dispatch-async) on dispatch_async.

Per the top answer, I implemented the following...

dispatch_async(dispatch_get_global_queue( DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^(void){
...
});

…to handle the synchronistic nature of my file download/saving.

Is this frowned upon? Would it be more beneficial in the long run to use NSURLSession instead?

Charles Carver
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden


  • Follow-Ups:
    • Re: NSSharingService with Animated GIFs?
      • From: Ken Thomases <email@hidden>
References: 
 >Re: NSSharingService with Animated GIFs? (From: Charles Carver <email@hidden>)
 >Re: NSSharingService with Animated GIFs? (From: Ken Thomases <email@hidden>)
 >Re: NSSharingService with Animated GIFs? (From: Charles Carver <email@hidden>)
 >Re: NSSharingService with Animated GIFs? (From: Ken Thomases <email@hidden>)

  • Prev by Date: Re: NSSharingService with Animated GIFs?
  • Next by Date: making NSView firstResponder/key
  • Previous by thread: Re: NSSharingService with Animated GIFs?
  • Next by thread: Re: NSSharingService with Animated GIFs?
  • Index(es):
    • Date
    • Thread