views:

44

answers:

2

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

[saveButton addTarget:self action:@selector(saveArray) forControlEvents:UIControlEventTouchUpInside];
+2  A: 

You'd have to replace self with an instance of the other class.

Rits
+2  A: 

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

[saveButton addTarget:targetObj action:@selector(saveArray) forControlEvents:UIControlEventTouchUpInside];
taskinoor