我有一个将图片上传到Facebook的应用。这是我的代码中的一部分:
[[self appDelegate] facebooking]; // checke that the user is loged in
NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
labeledImage, @"source",
FB_IMG_POST_TITLE,@"message",
nil];
[ [[self appDelegate] getFacebookVar] requestWithGraphPath:[NSString stringWithFormat: @"/me/photos?access_token=%@", self.appDelegate.getFacebookVar.accessToken] andParams:params andHttpMethod:@"POST" andDelegate:self];
我想
A)使上传过程成为一个不同的线程。
B)为用户提供取消上传的选项。
我该怎么做?
答案 0 :(得分:1)
首先,您没有正确使用facebook SDK。您不需要显式添加access_token。请参阅示例代码。
您不需要不同的线程,请求将以异步方式处理。是什么让你认为你需要这样做?
默认我不确定你能做B)。您可以更改sdk源以访问NSURLConnection(您可以取消)。