Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add timing info for _scrollViewDidChangeBounds:
  • Loading branch information
dmoagx committed Oct 8, 2015
1 parent 602c224 commit 2cb875f
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Source/SPObjectAdditions.m
Expand Up @@ -50,7 +50,9 @@ - (void)_scrollViewDidChangeBounds:(id)obj
{
NSMutableString *msg = [NSMutableString string];

[msg appendFormat:@"%s tripped!\n\n",__PRETTY_FUNCTION__];
[msg appendFormat:@"%s tripped!\n",__PRETTY_FUNCTION__];

[msg appendFormat:@" at %@ (mach time: %lf)\n\n",[NSDate date],[NSDate monotonicTimeInterval]];

retryDescribe:
[msg appendFormat:@"passed object (class <%@>): %@\n\n",[obj className],obj];
Expand Down Expand Up @@ -136,6 +138,7 @@ - (void)sp_addObserver:(id)notificationObserver selector:(SEL)notificationSelect
if(notificationSelector == @selector(_scrollViewDidChangeBounds:) && [notificationName isEqualToString:NSViewBoundsDidChangeNotification]) {
NSString *key = [NSString stringWithFormat:@"snd=%p,obs=%p",notificationSender,notificationObserver];
NSMutableString *val = [NSMutableString string];
[val appendFormat:@"at %@ (mach time: %lf)\n",[NSDate date],[NSDate monotonicTimeInterval]];
[val appendFormat:@"observer: %1$p (class %2$@) description: %1$@\n",notificationObserver,[notificationObserver className]];
if([notificationObserver isKindOfClass:[NSView class]]) {
[val appendFormat:@" view info: id=%@, tag=%ld\n",[(NSView *)notificationObserver identifier], [(NSView *)notificationObserver tag]];
Expand Down Expand Up @@ -176,7 +179,7 @@ + (void)load
- (void)sp_dealloc
{
NSString *key = [NSString stringWithFormat:@"=%p",self];
NSString *val = [NSString stringWithFormat:@"\ndealloc backtrace:\n%@\n\n",[NSThread callStackSymbols]];
NSString *val = [NSString stringWithFormat:@"\n%p dealloc\n at %@ (mach time: %lf)\n backtrace:\n%@\n\n",self,[NSDate date],[NSDate monotonicTimeInterval],[NSThread callStackSymbols]];

[gScrollViewDealloc setObject:val forKey:key];

Expand Down

0 comments on commit 2cb875f

Please sign in to comment.