Skip to content

Commit de84dc3

Browse files
committed
Add some debugging code to track down the elusive _scrollViewDidChangeBounds: issue
1 parent 9728737 commit de84dc3

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

Source/SPObjectAdditions.m

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,35 @@ - (BOOL)isNSNull
4242
return (self == null);
4343
}
4444

45+
- (void)_scrollViewDidChangeBounds:(id)obj
46+
{
47+
NSMutableString *msg = [NSMutableString string];
48+
49+
[msg appendFormat:@"%s tripped!\n\n",__PRETTY_FUNCTION__];
50+
51+
[msg appendFormat:@"passed object (class <%@>): %@\n\n",[obj className],obj];
52+
53+
if([obj isKindOfClass:[NSView class]]) {
54+
[msg appendString:@"View hierarchy:\n"];
55+
id parent = obj;
56+
while(parent) {
57+
[msg appendFormat:@"- (class <%@>): %@, id=%@, tag=%ld\n",
58+
[obj className],
59+
obj,
60+
[(NSView *)obj identifier],
61+
[(NSView *)obj tag]];
62+
parent = [parent superview];
63+
}
64+
[msg appendString:@"\n"];
65+
}
66+
67+
if([obj respondsToSelector:@selector(window)]) {
68+
[msg appendFormat:@"In Window: %@\n\n",[obj window]];
69+
}
70+
71+
[msg appendFormat:@"self: %p (class <%@>)\n\n",self,[self className]];
72+
73+
@throw [NSException exceptionWithName:NSInternalInconsistencyException reason:msg userInfo:nil];
74+
}
75+
4576
@end

0 commit comments

Comments
 (0)