我使用SimpleFTPSample上传文件,但我遇到了以下问题:
ftpStream = CFWriteStreamCreateWithFTPURL(NULL, (__bridge CFURLRef) urlOfHost);
assert(ftpStream != NULL);
它总是NULL,我不知道为什么?hostUrl 没问题,但 ftpStream 没有任何反应,我得到了断言。
网址:
urlOfHost = [[AppDelegate sharedAppDelegate] smartURLForString:[NSString stringWithFormat: @"ftp://wd150.1host.co.il/%@", orderKey]];
success = (urlOfHost != nil);
if (success) {
// Add the last part of the file name to the end of the URL to form the final
// URL that we're going to put to.
urlOfHost = CFBridgingRelease(CFURLCreateCopyAppendingPathComponent(NULL, (__bridge CFURLRef) url, (__bridge CFStringRef) [filePath lastPathComponent], false)
);
NSLog (@"%@", [urlOfHost description]);
success = (urlOfHost != nil);
}
有人可以知道吗?
预先感谢。