On Jun 25, 2008, at 10:20 AM, I. Savant wrote:

On Wed, Jun 25, 2008 at 11:02 AM, an0 <[EMAIL PROTECTED]> wrote:
So it forces me to keep all the fired NSURLConnections, right?
Otherwise, I can't tell which is which in my delegate methods.

  I believe so, yes. Presumably you'd have a controller that knows how
to, say, -getResourceAtURL: ... this method would create a request,
then create a connection with that request. It would conceivably add
that connection (if it was successfully created) to some collection
that identifies it in whatever way is useful. Perhaps an array of
dictionaries (whose keys are "url" and "connection", with methods to
find "connection for url" or vice-versa)? It depends on what you're
trying to do.

Just to mention, the natural approach would be a dictionary whose keys are connection objects with a value being a request, or maybe another dictionary with several pieces of info about a connection. The problem is that you can't use NSURLConnection objects as keys because they aren't copyable. For that, I recommend using [NSValue valueWithNonretainedObject:aConnection] as the key.

Cheers,
Ken

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to