Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我个人坚持“在 Objective-C 中使用点表示法和状态,以及使用行为的消息”原则。我不想讨论这个问题,但更多的是方法 mutableCopy 是状态还是行为?
也许我应该对状态和行为之间的区别进行更多研究,但据我所知,我不确定在这种情况下。
行为。对象的副本与“对象的某些特定属性”无关。它正在从原始对象创建一个新对象。所以请不要写
NSMutableArray *mutArr = array.mutableCopy;