作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在使用名为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];
@interface myClass : NSObject <BRRequestDelegate>
{
BRRequestCreateDirectory *createDir;
BRRequestDelete * deleteDir;
BRRequestListDirectory *listDir;
BRRequestUpload *uploadFile;
NSData *uploadData;
}
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];
}
});
最佳答案
刚刚检查了BlackRaccoon Git上的uploadFile函数,我发现在他们的示例中,他们没有alloc
一个BRRequestUpload对象,而是这样调用它:
uploadFile = [BRRequestUpload initWithDelegate: self];
这可能是您当机的原因吗?
关于ios - initWithDelegate问题-Blackraccoon,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17588218/
我有 2 名经理。一个是另一个的 child 。 Manager1.h @protocol LoginDelegate -(id) loginOK: (id) response; -(id) log
我已经在一个 swift 项目中导入了这个 Objective-C 类。MMLANSCanner.h #import @class Device; @protocol MMLANScannerDel
我是一名优秀的程序员,十分优秀!