How to write a method/message with multiple parameters?

前端 未结 3 790
夕颜
夕颜 2020-12-31 04:57

How do you write a method/message with multiple parameters?

EDIT: Like multiple parameters for a single method/message, I mean.

3条回答
  •  北海茫月
    2020-12-31 05:45

    Jeff accurately described what the methods look like. If you want to see how it would look as a C function, it would look something like:

    void drawRoundedRect_inView_withColor_fill( MyObject* self, SEL _cmd, NSRect aRect, NSView* aView, NSColor* color, BOOL fill );
    

    The parameter "names" all join together to form a single method name, and two hidden parameters, self and _cmd are added to the front.

提交回复
热议问题