On Sep 28, 2015, at 17:33 , Scott Ribe <scott_r...@elevated-dev.com> wrote: > > Ah, I just tried assignment to weak ivar then registration, gets the same > value. Anyway, avoiding monkeying with temp vars to fool the compiler is why > I re-did the API.
I’d say that the monkeying comes from ensuring you get the same pointer (aka arbitrary client identifier) when there’s no API contract about block literal pointer stability, AFAIK. Yet another library API would be to have the register call return an opaque value that’s passed to the unregister call (like the block-based NSNotificationCenter observation does). That eliminates the slight jankiness (in both your old and new designs) of using pointers as meaningless identifiers. _______________________________________________ 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