iPhone Facebook 应用程序 : Finding out where the error is?

标签 iphone ios syntax upload facebook-graph-api

所以我只是将 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
}

最佳答案

我要做的第一件事是通过设置断点或输出日志语句来验证该方法是否确实被调用。

我要做的第二件事是查看 API 文档,看看我调用的任何方法是否以任何方式提供错误。他们几乎肯定会这样做,所以请检查他们所说的。

我要做的第三件事是将设备设置为使用代理(例如 Charles )来查看请求是否实际上是通过网络发送出去的。

关于iPhone Facebook 应用程序 : Finding out where the error is?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6560016/

相关文章:

iphone - 设置标签字体

iphone - 如何更改索引 UITableView 中侧面字母的颜色?

ios - 在 uiviewcontroller 中添加文本字段

syntax - Makefile空白语法背后的原因是什么?

ios - 如何确定 iOS 通讯录中 ABPerson 的最后修改日期?

iphone - NSObject 没有存储在 objective-c 的 NSMutableArray 中

ios - 自定义 CIKernel 位移图

ios - 是否允许在 iPhone 应用程序中加载您自己的广告?

C++ 语法错误

c - 如何通过空指针访问成员