开发者

Is fast enumeration considered bad form or is it generally accepted?

Just wondering, it seems like it works pretty well but I want to make sure I am using generally accepted coding practices and not get开发者_开发知识库 into bad habits.

Thanks,

Nick


Yes, it's good form. It was introduced as the preferred style of enumeration in Objective-C 2.0, in fact. Use it wherever possible.


Fast enumeration is a recent addition to the language, so don't be concerned that you're not seeing it much in other people's code. It takes a while for people to adopt new habits.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜