Iphone 从另一个视图控制器调用Facebook API iOS的方法
我在一个外部视图控制器Iphone 从另一个视图控制器调用Facebook API iOS的方法,iphone,ios,facebook,uiviewcontroller,Iphone,Ios,Facebook,Uiviewcontroller,我在一个外部视图控制器APICallsViewController.m中有这个方法,当用户从另一个视图控制器MoreInfoCtrl.m触摸按钮时,我想调用它。我该怎么做呢 我已经在morinfo视图控制器.m#import“APICallsViewController.h”中发出了导入指令 这是用于将其集成到iOS应用程序中的Facebook API /* * Dialog: Request - send to a targeted friend. */ - (void)apiDialo
APICallsViewController.m
中有这个方法,当用户从另一个视图控制器MoreInfoCtrl.m
触摸按钮时,我想调用它。我该怎么做呢
我已经在morinfo视图控制器.m
#import“APICallsViewController.h”中发出了导入指令
这是用于将其集成到iOS应用程序中的Facebook API
/*
* Dialog: Request - send to a targeted friend.
*/
- (void)apiDialogRequestsSendTarget:(NSString *)friend {
currentAPICall = kDialogRequestsSendToTarget;
NSMutableDictionary* params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
@"Learn how to make your iOS apps social.", @"message",
friend, @"to",
nil];
HackbookAppDelegate *delegate = (HackbookAppDelegate *)[[UIApplication sharedApplication] delegate];
[[delegate facebook] dialog:@"apprequests"
andParams:params
andDelegate:self];
NSLog(@"Request - send to a targeted friend");
}
使用
NSNotification
添加观察者,然后在该按钮上发布通知。这必须来自应用程序代理还是来自MoreInfoCtrl.m?谢谢:)来自应用程序代表。在启动授权时将您的观察者添加到该方法,并在fbdidlogedin POSTNITION中添加到该方法