Is the 1st argument of an Objective C variadic function mandatory?

前端 未结 3 1522
生来不讨喜
生来不讨喜 2021-01-12 09:14

Here is an example of a variadic function in Obj C.

// This method takes an object and a variable number of args
- (voi         


        
3条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-01-12 09:46

    No, it doesn’t have to be an object. You can write a variadic function taking floats, for example:

    - (void) doSomethingWithFloats: (float) float1, ...;
    

提交回复
热议问题