Skip to content

Instantly share code, notes, and snippets.

@unreal
Created April 17, 2012 05:59
Show Gist options
  • Save unreal/2403806 to your computer and use it in GitHub Desktop.
Save unreal/2403806 to your computer and use it in GitHub Desktop.
// Foo.m:
- (instancetype) initWithResult:(NSTextCheckingResult *)result forLine:(NSString *)line {
if ( self = [super init] ) {
// do some stuff
}
return self;
}
+ (instancetype) parse:(NSString *)line {
// do some stuff
return [[self alloc] initWithResult:result forLine:line];
}
// Bar.h
@interface Bar : Foo
// Bar.m
- (instancetype) initWithResult:(NSTextCheckingResult *)result forLine:(NSString *)line {
if ( self = [super initWithResult:result forLine:line] ) {
// do some other stuff
}
return self;
}
// BarTest.m
- (void)setUp
{
[super setUp];
Bar * bar = [Bar parse:line]; // this causes the warning
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment