Re: NSURLDownload and userInfo
Re: NSURLDownload and userInfo
- Subject: Re: NSURLDownload and userInfo
- From: Trygve Inda <email@hidden>
- Date: Wed, 12 Mar 2008 07:39:15 +0000
- Thread-topic: NSURLDownload and userInfo
> Hi,
> Oh, sorry, replace everything in that message with NSURLDownload, same
> idea.
> I agree with your original approach, especially if you just need to
> store an int (or an NSNumber in this case).
>
> There is a reason almost every delegate method in Cocoa passes the
> delegate object as a parameter, and I am surprised NSURLDownload and
> NSURLRequest do not have userInfo ivars like many other Cocoa classes
> that do asynchronous operations (NSTimer for instance). In my opinion,
> subclassing is the simplest, most MVC compliant, and most Cocoa like
> solution.
>
> While I agree that for more complicated situations, multiple classes
> might be the best solution, I do not think it should be done in this
> case. You don't have to search through an array to match a connection
> with data that is irrevocably tied to that connection. Also, one of
> the purposes of subclassing is to prevent having to create wrapper
> classes. The data is tied to the NSURLDownload object itself, and
> there is no need to do any extra work to get it in one of the delegate
> methods.
Thanks for this. I too am surprised there is no userInfo in these classes
and wanted to be sure I wasn't overlooking something.
Trygve
_______________________________________________
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