Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to create private property in Objective-C?

Is it possible to create private property in Objective-C? I do know that a kind of private property functionality could be implemented in another way but I'm interested in particular question. Thanks.

like image 603
knuku Avatar asked Sep 08 '10 08:09

knuku


1 Answers

Yes, you can, but the code will looks a little bit strange. And it will only give you some warning if you call, you have to check for the warnings yourself

in your implementation file .m

@interface YourObject ()

@property (nonatomic, retain) NSMutableArray *infoArray;

@end
like image 146
vodkhang Avatar answered Nov 14 '22 21:11

vodkhang