Variables inside protocols in Objective-C
Why is there a provision to include a variable inside a protocol declaration, w开发者_StackOverflow社区hen is this ever used.
@protocol SampProtocol
int i;
- (void)func;
@end
There isn't any such provision. clang issues an error if you try to compile that code; gcc considers the int i;
statement as part of the parent scope (which is probably a bug).
精彩评论