• 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: Using NSURLSession in a command line tool?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Using NSURLSession in a command line tool?


  • Subject: Re: Using NSURLSession in a command line tool?
  • From: "Quinn \"The Eskimo!\"" <email@hidden>
  • Date: Mon, 16 Mar 2015 12:40:39 +0000

> On 16 Mar 2015, at 08:10, Daryle Walker <email@hidden> wrote:
>
> To: Cocoa Developers <email@hidden>,
>  "email@hidden Programming" <email@hidden>

Please don't cross post between large lists; it tends to cause problems for the members of both lists.

> How should something like a NSURLSession be used in a command-line tool?

I would solve this by running the main thread's run loop.  In theory you should also be able to get away parking [1] the main thread in <x-man-page://3/dispatch_main>.

Share and Enjoy
--
Quinn "The Eskimo!"                    <http://www.apple.com/developer/>
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

[1] This doesn't actually park the thread.  Rather, the thread terminates and the system spawns new threads to handle any enqueued blocks.  The final effect, however, is like you'd parked the main thread.


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden


References: 
 >Using NSURLSession in a command line tool? (From: Daryle Walker <email@hidden>)

  • Prev by Date: Using NSURLSession in a command line tool?
  • Next by Date: Is Technical Q&A QA1546 still valid?
  • Previous by thread: Using NSURLSession in a command line tool?
  • Next by thread: Is Technical Q&A QA1546 still valid?
  • Index(es):
    • Date
    • Thread