See an example of the official good, stay here to remember.
#import <Cocoa/Cocoa.h> @interface Nsmutablearray (variadicmethodexample)-(void) Appendobjects: (ID) Firstobject, ...; This method takes a nil-terminated list of objects. @end @implementation Nsmutablearray (variadicmethodexample)-(void) A Ppendobjects: (ID) firstobject, ... {ID eachobject;va_list argumentlist;if (firstobject)//The first argument isn ' t part of the VarArgs list, { //So we ' ll handle it separately. [Self addobject:firstobject]; Va_start (ArgumentList, firstobject); Start scanning for arguments after Firstobject. while (Eachobject = Va_arg (argumentlist, id))//As many times as we can get a argument of type "id" [self AddObject: Eachobject]; That isn ' t nil, add it-to-self ' s contents. Va_end (argumentlist); }} @end
Address: https://developer.apple.com/library/mac/qa/qa1405/_index.html
The most often seen should be used in the Uialertview.
-(ID) Initwithtitle: (NSString *) title message: (NSString *) message delegate: (ID/*<uialertviewdelegate>*/) Delegate Cancelbuttontitle: (NSString *) cancelbuttontitle otherbuttontitles: (NSString *) Otherbuttontitles, ... Ns_requires_nil_termination;
Ios... Ns_requires_nil_termination