Apply the
__attribute__((sentinel))
attribute to your variadic method, or alternatively, use the
NS_REQUIRES_NIL_TERMINATION
macro, which expands to the same. This way, the compiler will know that your variadic argument list needs to be 0-terminated.
- (void)foo:(id)arg1, ... NS_REQUIRES_NIL_TERMINATION
{
va_list args;
va_start(args, arg1);
// ...
}