__NSObserver should offer a DebugDescription explaining what it captures

Originator:patrick
Number:rdar://33105649 Date Originated:03-Juli-2017 02:30 PM
Status:Open Resolved:
Product:iOS + SDK Product Version:Xcode 9b2
Classification:Other Bug Reproducible:Always
 
Summary:
This is a duplicate of radar #33104144

I’m hunting down a retain cycle based on some blocks that strongly maintain my object and __NSObserver is in the middle. Unfortunately there’s zero debug output in there. I can use _ivarDescription but not everyone will know that trick and it takes extra time. This object should have a nice description (or at least a debugDescription) telling me what it maintains.


Steps to Reproduce:
Any code that uses the self addObserverForName:notificationName object:object queue:queue usingBlock:^(NSNotification *note) API on NSNotificationCenter.

Expected Results:
Internal management object should be more descriptive.

Actual Results:
Internal management object only prints it’s pointer.

Version:
Xcode 9b2

Notes:
No sample needed, open the source for __NSObserver and see that description is simply not implemented.

Screenshot: https://twitter.com/steipete/status/881813334936432641

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!