> On Sep 28, 2015, at 5:53 PM, Quincey Morris > <quinceymor...@rivergatesoftware.com> wrote: > > You lost me at “I”, because it’s not clear whether you are the library or the > client at that point. Was ‘authfun’ a property of the window controller (the > client/owner?) or something in the library? > > Is the ‘id’ in the new API a reference to the window controller/client/owner? > And it’s keyed because the reference is literally a key in a dictionary > inside the library whose value is a completion block?
Yes & yes. (Sort of, a C++ multimap actually, which is how one controller can have multiple callbacks registered.) > Actually, I think I have it. Originally, the block pointer was the client > identifier, but then you changed the identifier to an “arbitrary” pointer > supplied by the client. So, originally, the client had to keep a reference to > the block to serve as identifier later. Yes & yes. (In fact, the new API takes any kind of pointer, id or void*, and does not take ownership.) > I think your new API is superior, but I do want to ask: for the original API, > why could not ‘authfun’ just have been weak? I didn't think of that when working on it; that sounds like a good suggestion, BUT: "Assigning block literal to a weak variable; object will be released after assignment" :-P -- Scott Ribe scott_r...@elevated-dev.com http://www.elevated-dev.com/ https://www.linkedin.com/in/scottribe/ (303) 722-0567 voice _______________________________________________ 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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com