1

SimpleFTPSampleを使用してファイルをアップロードしていますが、次の行に問題があります。

ftpStream = CFWriteStreamCreateWithFTPURL(NULL, (__bridge CFURLRef) urlOfHost);
        assert(ftpStream != NULL);

常に NULL です。理由がわかりません。hostUrl は問題ありませんが、ftpStream には何も起こらず、アサートされます。

URL:

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);
    }

誰かが知ることができますか?

よろしくお願いします。

4

1 に答える 1

0

PutController のこのポーションを移行プログラムに追加しましたか。以下は、simpeFTPsample「ファイル読み取りエラー」を解決します

@implementation PutController{    
     uint8_t   _buffer[kSendBufferSize];    
}        
 -(uint8_t *)buffer{        
 return self->_buffer;    
}

この部分をプログラムに挿入しない場合。

 bytesRead = [self.fileStream read:self.buffer maxLength:kSendBufferSize];
于 2013-01-30T06:00:06.160 に答える