How to pass an array to an objc method that expects var args (eg …')
问题 I have a method in a library that looks like so: - (id)initWithSomeObjects:(NSString *)something, ... NS_REQUIRES_NIL_TERMINATION; I'd really like to call it with an array instead of var args, because the number of objects i'd like to pass in is changeable. Is there some way, using performSelector or NSInvocation or objc_msgSend or whatever, that i can call the var args method, with the arguments coming from an array? 回答1: There is no easy way to do this, because how arguments are passed goes