开发者

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).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜