I have a facebook like button in a custom tableview cell. In the class of my tableview I have the following function.
- (IBAction)sendLike:(id)sender
WithString: (NSString *)shareString
andUrl:(NSURL *)shareUrl{
//Do all kinds of things
[fbController setInitialText:shareString];
[fbController addURL:shareUrl];
[fbController setCompletionHandler:completionHandler];
[self presentViewController:fbController animated:YES completion:nil];
}
}
In my cellForRowAtIndexpath I am trying to call this method in the following way.
NSString *shareString = video.name;
NSURL *shareUrl = [NSURL URLWithString:video.url];
[cell.facebook addTarget:self action:@selector(sendLike: WithString:shareString andUrl:shareUrl)
forControlEvents:UIControlEventTouchUpInside];
But it is complaining that I should put ‘:’ in my @selector. Can anybody help ?
Thanks in advance.
You can try like this
in sendLike event