我对编程很陌生,所以请不要把我烧得太厉害。我下载了 Facebook 的 Hackbook 版本。但是,我有许多视图控制器将使用“共享此”按钮,但我不知道该怎么做。我知道我想使用已经存在的功能。
@implementation ViewConcertsViewController
...
-(IBAction)shareThis:(id)sender{
[appDelegate.facebook authorize:nil delegate:self];
APICallsViewController *apiViewController = [[APICallsViewController alloc] initWithNibName:nil bundle:nil];
[apiViewController shareButton];
}
然后在我的 APICallsViewController 中,我有:
-(void)shareButton{
[self performSelector:@selector(//what do I put in here!!!!)];
}
先感谢您。
这就是我所做的:
@implementation ViewConcertsViewController
...
-(IBAction)shareThis:(id)sender{
APICallsViewController *apiViewController = [[APICallsViewController alloc] initWithNibName:nil bundle:nil];
[apiViewController shareButton:sender];
}
@implementation APICallsViewController
...
-(void)shareButton:(id)sender{
SEL selector = NSSelectorFromString(@"getAppUsersFriendsNotUsing");
if ([self respondsToSelector:selector]) {
[self performSelector:selector];
}
}
谢谢你。