【发布时间】:2011-07-02 22:48:55
【问题描述】:
所以我刚刚将 Facebook 添加到了之前正在运行的应用程序中。而且我基本上只是包含了按下按钮以将所选图片上传/发布到 Facebook 的代码——什么也没发生。
有没有什么好的资源来学习 iOS Facebook 应用程序的语法?因为我迷路了。另外,你能告诉我为什么这个看似简单的代码不起作用吗?因为我几乎从演示应用示例中复制了它。
- (IBAction) sendPressed:(UIButton *)sender
{
for(UIViewController *controller in self.tabBarController.viewControllers)
{
if([controller isKindOfClass:[FirstViewController class]])
{
FirstViewController *firstViewController = (FirstViewController *)controller;
[firstViewController realLabel];
}
}
Facebook *facebook = [[Facebook alloc] initWithAppId:@"198223696897308"];
NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
image, @"picture",
nil];
[facebook requestWithGraphPath:@"me/photos"
andParams:params
andHttpMethod:@"POST"
andDelegate:self];
self.tabBarController.selectedIndex = 0;//switch over to the first view to see if it worked
}
【问题讨论】:
标签: iphone ios syntax upload facebook-graph-api