I have this below delegate method that receives stickerURLString as input:
- (void)selectedSticker:(NSString *)stickerURLString {
//...
[self.stickerPreviewButton addTarget:self action:@selector(sendStickerPreviewButtonPressed:) forControlEvents:UIControlEventTouchUpInside];
//...
}
And the selector calls this method sendStickerPreviewButtonPressed:
- (void)sendStickerPreviewButtonPressed: (NSString *)stickerURLString {
[self.delegate InputFunctionView:self sendSticker:stickerURLString];
}
As you can see in order to make this work as expected I have to pass on stickerURLString from selectedSticker method to sendStickerPreviewButtonPressed.
I have tried this:
[self.stickerPreviewButton performSelector:@selector(sendStickerPreviewButtonPressed:) withObject:stickerURLString];
instead of this:
[self.stickerPreviewButton addTarget:self action:@selector(sendStickerPreviewButtonPressed:) forControlEvents:UIControlEventTouchUpInside];
But I got "terminating with uncaught exception of type NSException" error.
So anyone knows how to pass on string parameter to another method through button selector?