Possible Duplicate:
Semicolon after the method name in Objective-C implementation file
I noticed that both
- (void)encodeWithCoder:(NSCoder *)aCoder;
{
}
and
- (void)encodeWithCoder:(NSCoder *)aCoder
{
}
works.
Using ; is kind of awkward though. Why having ; works is beyond me. Wouldn’t work in C++
The thing is something; should be equivalent with something{}; hence something ;{} should be equivalent with something {};{} which is just wrong.
For example if(true) a=b; is the same with if(true){a=b};
Compiler ignores the semicolon, this happens only with function names.This happens when people try to copy the function name from .h(interface) to .m(implementation)file.I also observed the same while working with objective c.