NSArray creation with variable argument lists

2 Solutions Collect From Internet About “NSArray creation with variable argument lists”

Null terminated variable argument lists, or va_lists, keep walking the list of arguments until they encounter a placeholder or sentinel, which is nil.

Since the method has no way of knowing how many arguments you are passing, it needs the sentinel (nil) to tell where the list ends.

To mark the end of the list of objects.

Here’s a discussion from CocoaBuilder.