diff options
author | gtm.daemon <gtm.daemon@7dc7ac4e-7543-0410-b95c-c1676fc8e2a3> | 2010-06-04 15:35:57 +0000 |
---|---|---|
committer | gtm.daemon <gtm.daemon@7dc7ac4e-7543-0410-b95c-c1676fc8e2a3> | 2010-06-04 15:35:57 +0000 |
commit | 6c2f14bc180418cfad42582be6ef1cc6a5413368 (patch) | |
tree | 3b2b46d62d4889ba0e57f0fcbbc27e400ab5a22a /iPhone | |
parent | 8ceff783b1fd62b67c7a6301228af9f7266e183b (diff) |
[Author: dmaclach]
Turns on the undeclared-selector warning. This may cause builds to fail if they are using
our configs. Also cleaned up some whitespace issues.
R=thomasvl
DELTA=94 (71 added, 22 deleted, 1 changed)
Diffstat (limited to 'iPhone')
-rw-r--r-- | iPhone/GTMUIView+SubtreeDescription.h | 6 | ||||
-rw-r--r-- | iPhone/GTMUIView+SubtreeDescription.m | 8 |
2 files changed, 10 insertions, 4 deletions
diff --git a/iPhone/GTMUIView+SubtreeDescription.h b/iPhone/GTMUIView+SubtreeDescription.h index 1e714ed..627298a 100644 --- a/iPhone/GTMUIView+SubtreeDescription.h +++ b/iPhone/GTMUIView+SubtreeDescription.h @@ -44,4 +44,10 @@ @end +@protocol GTMUIViewSubtreeDescription +// A UIView can implement this and it can add it's own custom description +// in gtm_subtreeDescriptionLine. +- (NSString *)myViewDescriptionLine; +@end + #endif // DEBUG diff --git a/iPhone/GTMUIView+SubtreeDescription.m b/iPhone/GTMUIView+SubtreeDescription.m index bae0e2f..519aed0 100644 --- a/iPhone/GTMUIView+SubtreeDescription.m +++ b/iPhone/GTMUIView+SubtreeDescription.m @@ -31,7 +31,6 @@ static void AppendLabelFloat(NSMutableString *s, NSString *label, float f) { } } - static NSMutableString *SublayerDescriptionLine(CALayer *layer) { NSMutableString *result = [NSMutableString string]; [result appendFormat:@"%@ %p {", [layer class], layer]; @@ -60,7 +59,7 @@ static NSMutableString *SublayerDescriptionAtLevel(CALayer *layer, int level) { [result appendString:SublayerDescriptionLine(layer)]; // |sublayers| is defined in the QuartzCore framework, which isn't guaranteed // to be linked to this program. (So we don't include the header.) - NSArray *layers = [layer performSelector:@selector(sublayers)]; + NSArray *layers = [layer performSelector:NSSelectorFromString(@"sublayers")]; for (CALayer *l in layers) { [result appendString:SublayerDescriptionAtLevel(l, level+1)]; } @@ -127,11 +126,12 @@ static NSMutableString *SublayerDescriptionAtLevel(CALayer *layer, int level) { // for debugging dump the layer hierarchy, frames and isHidden. - (NSString *)sublayersDescription { CALayer *layer = [self layer]; - if (![layer respondsToSelector:@selector(sublayers)]) { + SEL sublayers = NSSelectorFromString(@"sublayers"); + if (![layer respondsToSelector:sublayers]) { return @"*** Sorry: This app is not linked with the QuartzCore framework."; } NSMutableString *result = SublayerDescriptionLine(layer); - NSArray *layers = [layer performSelector:@selector(sublayers)]; + NSArray *layers = [layer performSelector:sublayers]; for (CALayer *l in layers) { [result appendString:SublayerDescriptionAtLevel(l, 1)]; } |