-1

How can I announce a class method in protocal? I have tried like this:

@protocal
+(void)methodA;
@end;

but this leads to crash.

rmaddy
  • 307,833
  • 40
  • 508
  • 550

1 Answers1

0

If your intent is to specify a class method that conforming classes must implement, then, yes, you can define class methods in your protocol requirements.

But your protocol needs a name. And @protocol was misspelled.

@protocol ProtocolNameHere
+(void)methodA;
@end
Rob
  • 392,368
  • 70
  • 743
  • 952