0

I inherited another developer code, but didn't understood the following code (Notice the ';' in the of first line):

-(id) initWithTarget:(id)target  AndAction:(void(*)(id target,id sender ,NSString* xml))action; {
    self = [super init];
    if (self) {
        [self setTargetAction:action];
        [self setActionDelegate:target];
    }
    return self; }

This code compiles fine without any warning \ error. Is it just looks to me, or this is a method declaration (which of course won't have any definition), and another block which couldn't be performed (without any method name) ???

yonivav
  • 994
  • 11
  • 18

1 Answers1

0

That semi-colon is simply ignored by the compiler. It's a convenience so that you can copy the method definition from the @interface into the @implementation and just get on with things. It makes no functional difference if it's there or not.

Wain
  • 118,658
  • 15
  • 128
  • 151
  • I checked it by adding semi-colon to `applicationDidFinishLaunching:WithOptions:` method, and you are right. Thank you ! – yonivav Apr 02 '14 at 11:08