Permalink
Browse files

Add timing info for _scrollViewDidChangeBounds:

  • Loading branch information...
dmoagx committed Oct 8, 2015
1 parent 602c224 commit 2cb875fb99e0c017b545b8e8427eb565e15cca1e
Showing with 5 additions and 2 deletions.
  1. +5 −2 Source/SPObjectAdditions.m
@@ -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];
@@ -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]];
@@ -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];

0 comments on commit 2cb875f

Please sign in to comment.