1
我用SimpleFTPSample上傳文件,但我有問題,線:上傳文件到FTP - iOS設備
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);
}
有人能知道嗎?
從預先感謝。
向我們展示如何創建你的'urlOfHost'。 – trojanfoe
我編輯我的問題。謝謝 – Segev