How can I pass a parameter to this function?

前端 未结 6 962
既然无缘
既然无缘 2020-12-14 23:34

I have the following code:

[replyAllBtn addTarget:self.target action:@selector(ReplyAll:) forControlEvents:UIControlEventTouchUpInside];

- (void)replyAll:(         


        
6条回答
  •  孤城傲影
    2020-12-14 23:52

    The MVC model used in Cocoa works differently. Basically, the idea is that a control (=view) such as a button only lets a function know it was pressed, not knowing what this means. The function then has to know all the dynamics and dependencies. In your case, it's the function that has to find the parameter. To accomplish that, you'll "bind" other objects to the function (= controller).

    I suggest you read a few Cocoa tutorials first if you want to get ahead with iPhone programming.

提交回复
热议问题