在Objective C中定義私有的成員變量


使用了LLVM以后,終於可以定義私有的成員變量了。

@interface RadioViewController ()
{
@private
    UIBackgroundTaskIdentifier task;
}

@property (strong, nonatomic) AVPlayer *audioPlayer;

@end

請注意,在m文件的categories需要使用花括號({})@property還是需要定義在花括號的外面。

這樣在

@implementation RadioViewController

@end

中間就可以自由的使用這個成員變量(field)task了。

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM