Re: NSURLDownload and userInfo

2008-03-12 Thread Adam Leonard
Well, there are a few more places I see it used for delegate-like operations :) NSCachedURLResponse - also in WebKit NSTrackingArea NSEvent (called userData) NSBeginAlertSheet() (called contextInfo) So yeah, you are right it is not used everywhere, but I think it is used enough for it to be

Re: NSURLDownload and userInfo

2008-03-11 Thread Adam Leonard
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

Re: NSURLDownload and userInfo

2008-03-10 Thread Clint Shryock
Do you have two instances of NSURLDownload? if they are declared in the .h file you could test for equality in the downloadDidFinish: delegate method. - (void)downloadDidBegin:(NSURLDownload *)download { if(download == myNSURLDownloadA) { // something for a } if(download ==

Re: NSURLDownload and userInfo

2008-03-10 Thread Ben Lachman
Alternatively, if you're managing more than two requests at a time you can declare a mutable array of connections and then build a dictionary for each connection that includes any info you want you delegate to have available. I have a method that build the connection dict for a connection

Re: NSURLDownload and userInfo

2008-03-10 Thread Jens Alfke
On 10 Mar '08, at 6:35 PM, Ben Lachman wrote: Alternatively, if you're managing more than two requests at a time you can declare a mutable array of connections and then build a dictionary for each connection that includes any info you want you delegate to have available. I think it's

Re: NSURLDownload and userInfo

2008-03-10 Thread Ben Lachman
On Mar 10, 2008, at 9:52 PM, Jens Alfke wrote: On 10 Mar '08, at 6:35 PM, Ben Lachman wrote: Alternatively, if you're managing more than two requests at a time you can declare a mutable array of connections and then build a dictionary for each connection that includes any info you want you

Re: NSURLDownload and userInfo

2008-03-10 Thread Adam Leonard
Or, yet another solution: Just subclass NSURLConnection (say MyUserInfoURLConnection), add a userInfo ivar, drop in some accessors, and you are good to go. :) [userInfoConnection userInfo]; Adam Leonard On Mar 10, 2008, at 6:52 PM, Jens Alfke wrote: On 10 Mar '08, at 6:35 PM, Ben Lachman