diff options
Diffstat (limited to 'Source')
-rw-r--r-- | Source/SPObjectAdditions.m | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/Source/SPObjectAdditions.m b/Source/SPObjectAdditions.m index 4f2eef1e..c211809e 100644 --- a/Source/SPObjectAdditions.m +++ b/Source/SPObjectAdditions.m @@ -48,13 +48,24 @@ [msg appendFormat:@"%s tripped!\n\n",__PRETTY_FUNCTION__]; +retryDescribe: [msg appendFormat:@"passed object (class <%@>): %@\n\n",[obj className],obj]; + if ([obj isKindOfClass:[NSNotification class]]) { + NSNotification *notif = (NSNotification *)obj; + [msg appendFormat:@"unwrapping NSNotification named '%@' (userInfo=%@)\n\n", + [notif name], + [notif userInfo]]; + obj = [notif object]; + goto retryDescribe; + } + if([obj isKindOfClass:[NSView class]]) { - [msg appendString:@"View hierarchy:\n"]; + [msg appendString:@"View hierarchy (parents):\n"]; id parent = obj; while(parent) { - [msg appendFormat:@"- (class <%@>): %@, id=%@, tag=%ld\n", + [msg appendFormat:@"- %p (class <%@>): %@, id=%@, tag=%ld\n", + obj, [obj className], obj, [(NSView *)obj identifier], @@ -62,6 +73,12 @@ parent = [parent superview]; } [msg appendString:@"\n"]; + + [msg appendString:@"View hierarchy (own children): \n"]; + for (id child in [(NSView *)obj subviews]) { + [msg appendFormat:@"- %p\n",child]; + } + [msg appendString:@"\n"]; } if([obj respondsToSelector:@selector(window)]) { |