Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/facebook/8.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Facebook iPhone SDK:上传图像时显示进度条_Iphone_Facebook_Progress Bar - Fatal编程技术网

Facebook iPhone SDK:上传图像时显示进度条

Facebook iPhone SDK:上传图像时显示进度条,iphone,facebook,progress-bar,Iphone,Facebook,Progress Bar,当我的iPhone应用程序将图像上传到Facebook时,我想显示一个进度条。可能吗 我能满足我的每一个要求吗?我还使用FBRequest检查扩展权限,有时会花费很多时间 谢谢。您不知道它什么时候会让您登录,但您可以在UIActivityIndicator视图中显示。 单击“发布”按钮时启动它,进入“didConnect”方法时结束它。对于进度条,您可以进行一些修改。在FBRequest.h文件中,在FBRequestDelegate协议中添加此行: - (void)request:(FBReq

当我的iPhone应用程序将图像上传到Facebook时,我想显示一个进度条。可能吗

我能满足我的每一个要求吗?我还使用FBRequest检查扩展权限,有时会花费很多时间


谢谢。

您不知道它什么时候会让您登录,但您可以在UIActivityIndicator视图中显示。
单击“发布”按钮时启动它,进入“didConnect”方法时结束它。对于进度条,您可以进行一些修改。在
FBRequest.h
文件中,在
FBRequestDelegate
协议中添加此行:

- (void)request:(FBRequest *)request didSendBodyData:(NSInteger)bytesWritten totalBytesWritten:(NSInteger)totalBytesWritten totalBytesExpectedToWrite:(NSInteger)totalBytesExpectedToWrite;
之后,在
FBRequest.m
文件中添加此函数:

- (void)connection:(NSURLConnection *)connection didSendBodyData:(NSInteger)bytesWritten totalBytesWritten:(NSInteger)totalBytesWritten totalBytesExpectedToWrite:(NSInteger)totalBytesExpectedToWrite {
    if ([_delegate respondsToSelector:@selector(request:didSendBodyData:totalBytesWritten:totalBytesExpectedToWrite:)]) {
        [_delegate request:self didSendBodyData:bytesWritten totalBytesWritten:totalBytesWritten totalBytesExpectedToWrite:totalBytesExpectedToWrite];
    }
}
现在,每次将更多数据发布到服务器时,您的代理都会收到一条消息。因此,基本上,如果您在代理中实现此功能,您应该在日志中看到一些活动:

- (void)request:(FBRequest *)request didSendBodyData:(NSInteger)bytesWritten totalBytesWritten:(NSInteger)totalBytesWritten totalBytesExpectedToWrite:(NSInteger)totalBytesExpectedToWrite
{
    NSLog(@"%d bytes out of %d sent.", totalBytesWritten, totalBytesExpectedToWrite);
}

如果您在将此内容嵌入当前Facebook SDK时遇到任何问题,请告诉我。

您是否解决过此进度条问题?如果是,请分享你的解决方案好吗?不,对不起。我没有找到解决办法。我找到了-如果你仍然感兴趣:)是的,我仍然感兴趣。你能为我的问题补充一个答案来解释你的解决方案吗?谢谢。你能帮我在最新的SDK 3.1中实现这个吗??谢谢