是否可以在 Objective-C 中创建私有财产? [英] Is it possible to create private property in Objective-C?
本文介绍了是否可以在 Objective-C 中创建私有财产?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
是否可以在 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.
推荐答案
是的,你可以,但是代码看起来有点奇怪.而且如果你打电话它只会给你一些警告,你必须自己检查警告
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
在您的实现文件 .m
@interface YourObject ()
@property (nonatomic, retain) NSMutableArray *infoArray;
@end
这篇关于是否可以在 Objective-C 中创建私有财产?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文