objective c - How to pass method arguments to a selector -
if have method this:
- (void) foo { } then can access through selector this:
@selector(foo) but if have method this:
- (void) bar:(nsstring *)str arg2:(nsstring *)str2 { } then how access through selector?
to handle arbitrary number of selectors should use nsinvocation, can handle 2 objects using standard performwithselector stuff
[foo performselector:@selector(bar:arg2:) withobject:obj1 withobject:obj2]
Comments
Post a Comment