Why does NSArray arrayWithObjects require a terminating nil?

前端 未结 6 830
时光取名叫无心
时光取名叫无心 2020-12-03 01:29

I understand that it marks the end of a set of varargs, but why can\'t it be implemented in such a way that doesn\'t require the nil?

6条回答
  •  离开以前
    2020-12-03 02:27

    You can use now the new Collection Literals (alias Container Literals) in Objective-C. See http://clang.llvm.org/docs/ObjectiveCLiterals.html

提交回复
热议问题