Hey guys,
I have an init method defined as:
- (id)initWithX:(float)inX AndY:(float)inY
{
if (self = [super init])
{
[self setX:inX andY:inY];
}
return self;
}
When I use this method like this:
MyObject* myObject = [[MyObject alloc] initWithX:0.0 AndY:0.0];
I get a warning saying: "warning: initialization from distinct Objective-C type"
But interestingly, if I change the "AndY:" to "andY:" in the method signature, the warning goes away.
Why would this be happening? Surely the naming of my method shouldn't affect its return type??
After a little more investigation, changing the method name use use the lowercase 'andY' didn't make the warning disappear. I cleaned all targets, and rebuilt and the warning didn't show. But it came back after another recompile. Odd.