• 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
Checking for success/failure in NSURLSession completion handlers
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Checking for success/failure in NSURLSession completion handlers


  • Subject: Checking for success/failure in NSURLSession completion handlers
  • From: Daryle Walker <email@hidden>
  • Date: Mon, 30 Mar 2015 02:54:21 -0400

This is inspired by me incorrectly checking the result of NSFileManager's "- moveItemAtURL: toURL: error:” method. This call is within a block function in a call of NSURLSession’s "- downloadTaskWithURL: completionHandler:”. Said completion handler has a prototype of "void (^)(NSURL *location, NSURLResponse *response, NSError*error)”. Am I supposed to check for success by seeing whether or not “error” is nil, or if whether or not “location” (and/or “response”) is NOT nil?

Unlike some older APIs, NSURLSession’s method arguments that are block pointers do not have those inner functions’ parameters and/or return values fully explained. The URL Loading System Programming Guide does not explain what’s expected of those blocks either. File a bug?

—
Daryle Walker
Mac, Internet, and Video Game Junkie
darylew AT mac DOT com


 _______________________________________________
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


  • Follow-Ups:
    • Re: Checking for success/failure in NSURLSession completion handlers
      • From: "Quinn \"The Eskimo!\"" <email@hidden>
  • Prev by Date: trying to build configd, understanding dns more
  • Next by Date: Re: trying to build configd, understanding dns more
  • Previous by thread: Re: trying to build configd, understanding dns more
  • Next by thread: Re: Checking for success/failure in NSURLSession completion handlers
  • Index(es):
    • Date
    • Thread