Sangram Anand Sangram Anand - 1 year ago 93
iOS Question

Passing parameters in self action:@selector

I am trying to add a NSIndexpath as parameter to a method through

[self action:@selector(showDetailedImage)];

Is it possible to add an extra parameter(
) to this method?

Answer Source

No, you can not pass arguments, you can only show that this selector will take that many numbers of arguments.

If you need to do this, you can create a property and access it from the method showDetailedImage.

However you can use this selector:

[self performSelector:@selector(showDetailedImageIndex:) withObject:objectOfNSIndex];
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download