在Objective C中定义私有的成员变量
使用了LLVM以后,终于可以定义私有的成员变量了。
@interface RadioViewController () { @private UIBackgroundTaskIdentifier task; } @property (strong, nonatomic) AVPlayer *audioPlayer; @end
请注意,在m文件的categories需要使用花括号({})@property还是需要定义在花括号的外面。
这样在
@implementation RadioViewController
@end
中间就可以自由的使用这个成员变量(field)task了。
作者:Jake Lin(Jake's Blog on 博客园)
出处:http://procoder.cnblogs.com
本作品由Jake Lin创作,采用知识共享署名-非商业性使用-禁止演绎 2.5 中国大陆许可协议进行许可。 任何转载必须保留完整文章,在显要地方显示署名以及原文链接。如您有任何疑问或者授权方面的协商,请给我留言。
出处:http://procoder.cnblogs.com
本作品由Jake Lin创作,采用知识共享署名-非商业性使用-禁止演绎 2.5 中国大陆许可协议进行许可。 任何转载必须保留完整文章,在显要地方显示署名以及原文链接。如您有任何疑问或者授权方面的协商,请给我留言。