• 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: Exception using custom input stream for NSURLRequest
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Exception using custom input stream for NSURLRequest


  • Subject: Re: Exception using custom input stream for NSURLRequest
  • From: Jens Alfke <email@hidden>
  • Date: Mon, 06 Feb 2012 08:59:43 -0800


On Feb 6, 2012, at 4:43 AM, Quinn The Eskimo! wrote:

IMPORTANT:  These methods are considered private API and thus a) engender a binary compatibility liability, and b) are disallowed for App Store apps.

a) If this bug is fixed in the future (god forbid) then my methods just won’t be called anymore, so this doesn’t seem like a problem. Conversely, if someone at Apple just changes those messages without actually fixing the underlying bug that sends them to innocent 3rd party classes, then I will send them a package of poop* in the mail.

b) Really? I know the App Store checker will make sure I’m not _calling_ private methods, but does it really keep me from creating a method with an “_” at the start of its name?

A better solution is to use a bound pair of streams, as returned by CFStreamCreateBoundPair.  The POST functionality in the SimpleURLConnections sample code shows the way.

Um, a couple of quick notes before I dive into this:

[1] This tip would have been even better if you’d pointed it out in your message on Friday, before I spent half the weekend struggling with this problem. :/
[2] I’ve never heard of CFStreamCreateBoundPair before, and the doc say basically nothing; I’m guessing it connects the streams such that writing to the output stream causes bytes to become available on the input stream? So in this case I would set the input stream as the HTTPBodyStream, then set my code as the delegate of the output stream and write stuff to it as space becomes available?
[3] “SimpleURLConnections” should be renamed “URLConnectionsShowingOffSubtleStreamTricksFewMortalsKnowAbout”. Then I might not have ignored it when it showed up in a search :-/

But all snarkiness aside, the bound pair does look like a great solution to this problem. Thanks!

—Jens

* Just kidding, friendly DHS eavesdroppers! I understand that mailing poop is unsanitary and unAmerican.

 _______________________________________________
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: 
 >Re: Exception using custom input stream for NSURLRequest (From: Jeff Johnson <email@hidden>)
 >Re: Exception using custom input stream for NSURLRequest (From: "Quinn \"The Eskimo!\"" <email@hidden>)

  • Prev by Date: Re: Exception using custom input stream for NSURLRequest
  • Next by Date: Proxy servers vs localhost
  • Previous by thread: Re: Exception using custom input stream for NSURLRequest
  • Next by thread: HTTPBodyStream without chunked encoding?
  • Index(es):
    • Date
    • Thread