Permalink
Browse files

Add some debugging code to track down the elusive _scrollViewDidChang…

…eBounds: issue
  • Loading branch information...
dmoagx committed Aug 3, 2015
1 parent 9728737 commit de84dc3f4beaa370d1a8bfe02df41cfe450f59b2
Showing with 31 additions and 0 deletions.
  1. +31 −0 Source/SPObjectAdditions.m
@@ -42,4 +42,35 @@ - (BOOL)isNSNull
return (self == null);
}
- (void)_scrollViewDidChangeBounds:(id)obj
{
NSMutableString *msg = [NSMutableString string];
[msg appendFormat:@"%s tripped!\n\n",__PRETTY_FUNCTION__];
[msg appendFormat:@"passed object (class <%@>): %@\n\n",[obj className],obj];
if([obj isKindOfClass:[NSView class]]) {
[msg appendString:@"View hierarchy:\n"];
id parent = obj;
while(parent) {
[msg appendFormat:@"- (class <%@>): %@, id=%@, tag=%ld\n",
[obj className],
obj,
[(NSView *)obj identifier],
[(NSView *)obj tag]];
parent = [parent superview];
}
[msg appendString:@"\n"];
}
if([obj respondsToSelector:@selector(window)]) {
[msg appendFormat:@"In Window: %@\n\n",[obj window]];
}
[msg appendFormat:@"self: %p (class <%@>)\n\n",self,[self className]];
@throw [NSException exceptionWithName:NSInternalInconsistencyException reason:msg userInfo:nil];
}
@end

0 comments on commit de84dc3

Please sign in to comment.