0
votes

NSArray arrayWithObjects needs nil at the end, NSString stringWithFormat and NSLog() doesn't. Why?

[NSArray arrayWithObjects:<#(id), ...#>, nil] 

[NSString stringWithFormat:<#(NSString *), ...#>]

NSLog(<#NSString *format, ...#>)
1

1 Answers

4
votes

Because -stringWithFormat: and NSLog can infer the number of arguments based on their format strings (the first argument). -arrayWithObjects: can't.