Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to call a selector in a different class

How would this code be different if the method was in a different class?

[saveButton addTarget:self action:@selector(saveArray) forControlEvents:UIControlEventTouchUpInside];
like image 237
node ninja Avatar asked Oct 11 '10 14:10

node ninja


1 Answers

Pass the object (which responds to the method) as the target parameter.

[saveButton addTarget:targetObj action:@selector(saveArray) forControlEvents:UIControlEventTouchUpInside];
like image 96
taskinoor Avatar answered Sep 27 '22 22:09

taskinoor