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

旧城冷巷雨未停 提交于 2019-12-08 17:28:07

问题


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.


回答1:


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


来源:https://stackoverflow.com/questions/3665698/is-it-possible-to-create-private-property-in-objective-c

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!