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 2.0 中的首选枚举风格引入的。尽可能使用它。
快速枚举是该语言最近添加的一项功能,因此不必担心您在其他人的代码中看不到它。人们需要一段时间才能养成新习惯。