Duplicate Method Names - Objective-c
Posted
by evanchri
on Stack Overflow
See other posts from Stack Overflow
or by evanchri
Published on 2010-05-24T23:46:52Z
Indexed on
2010/05/24
23:51 UTC
Read the original article
Hit count: 210
iphone
|objective-c
Why does this compile with out any errors or warnings?
@interface ObjectTest : NSObject {
}
-(void)iAmADoubleMethod;
-(void)iAmADoubleMethod;
@end
@implementation ObjectTest
-(void)iAmADoubleMethod {
NSLog(@"IAmADoubleMethod");
}
@end
I came across this in a project I am working on. I come from a C++ background, so I figure I would get at least a warning for this. Not only would I like to know why it complies but could this code cause any problems?
Thanks.
© Stack Overflow or respective owner