gpt4 book ai didi

ios - initWithDelegate问题-Blackraccoon

转载 作者:行者123 更新时间:2023-12-01 16:49:13 26 4
gpt4 key购买 nike

我正在使用名为BlackRaccoon的软件包将文件上传到FTP服务器。我真的很难解决一个我无法弄清楚的基本授权概念。

在我的上载类.m文件中,我有一个调用BlackRaccoon上传请求的方法。我使用以下代码:

uploadFile = [BRRequestUpload initWithDelegate: self];

uploadFile.path = @"/filehere.txt";
uploadFile.hostname = @"xxx";
uploadFile.username = @"xxx";
uploadFile.password = @"xxx";

//we start the request
[uploadFile start];

在我的.h文件中,我具有以下内容:
@interface myClass : NSObject <BRRequestDelegate>
{
BRRequestCreateDirectory *createDir;
BRRequestDelete * deleteDir;
BRRequestListDirectory *listDir;

BRRequestUpload *uploadFile;

NSData *uploadData;

}

每次编译和运行时,我都会在BlackRaccoon文件中某处收到错误,例如:

__25- [BRStreamInfo openRead:] _ block_invoke [第190行]服务器未响应。超时。

在发现此错误时,我发现自己处于创建读取流的方法中,尤其是:
    request.didOpenStream = NO;
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, timeout * NSEC_PER_SEC), dispatch_get_local_queue(), ^{
if (!request.didOpenStream && request.error == nil)
{
InfoLog(@"No response from the server. Timeout.");
request.error = [[BRRequestError alloc] init];
request.error.errorCode = kBRFTPClientStreamTimedOut;
[request.delegate requestFailed: request];
[request.streamInfo close: request];
}
});

我对此完全不满意。我们的服务器已启动并正在运行,并且我们的android设备或应用(例如“FTP Sprite”)没有超时问题。

我非常确定问题出在initWithDelegate之类。我只是认为即时出价委派不正确,但我不确定为什么。有人有什么想法吗?我知道我需要在某个地方初始化(id),但我只是不知道在哪里或如何。

谢谢!

最佳答案

刚刚检查了BlackRaccoon Git上的uploadFile函数,我发现在他们的示例中,他们没有alloc一个BRRequestUpload对象,而是这样调用它:

uploadFile = [BRRequestUpload initWithDelegate: self];
这可能是您当机的原因吗?

关于ios - initWithDelegate问题-Blackraccoon,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17588218/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com