Okay, I think I have it whittled down, but the solution is strange... The warning seems to be dependent on the method names, unless I'm doing something stupid (highly possible). Look at the two classes below. The first one compiles perfectly with no errors. The second one compiles with the error mentioned previously. The only difference is in the method names (one uses initWithArray/nodeWithArray and the other uses initWithPath/nodeWithPath).
The good class header:
#import <UIKit/UIKit.h>
#include "cocos2d.h"
@interface TestLayer : Layer {
}
-(id) initWithArray:(NSMutableArray*)path;
+(id) nodeWithArray:(NSMutableArray*)array;
@end
The good class implementation:
#import "TestLayer.h"
@implementation TestLayer
-(id) initWithArray:(NSMutableArray*)array {
self = [super init];
if (self != nil) {
//do stuff with array
NSLog(@"array size: %d", [array count]);
}
return self;
}
+(id) nodeWithArray:(NSMutableArray*)array {
return [[[TestLayer alloc] initWithArray:array] autorelease];
}
@end
The bad class header:
#import <UIKit/UIKit.h>
#include "cocos2d.h"
@interface TestLayer : Layer {
}
-(id) initWithPath:(NSMutableArray*)array;
+(id) nodeWithPath:(NSMutableArray*)array;
@end
The bad class implementation:
#import "TestLayer.h"
@implementation TestLayer
-(id) initWithPath:(NSMutableArray*)array {
self = [super init];
if (self != nil) {
//do stuff with array
NSLog(@"array size: %d", [array count]);
}
return self;
}
+(id) nodeWithPath:(NSMutableArray*)array {
return [[[TestLayer alloc] initWithPath:array] autorelease];
}
@end
(Note that I have both of these in one test class in my code, with sections commented out. I split it into two classes here for easy viewing. )
Any idea what's causing this strangeness? Or am I overlooking something obvious?