Objective c 通过FTP连接删除服务器上的文件夹
我正在学习与iOS联网 如何删除通过FTP连接的远程服务器上的文件夹 我尝试使用cfurldistrource函数,但失败了。它只删除文件 我尝试过以下代码:Objective c 通过FTP连接删除服务器上的文件夹,objective-c,ios,ftp,Objective C,Ios,Ftp,我正在学习与iOS联网 如何删除通过FTP连接的远程服务器上的文件夹 我尝试使用cfurldistrource函数,但失败了。它只删除文件 我尝试过以下代码: NSURL * url; SInt32 status = 0; url = [[NSURL alloc] initWithString:@"ftp://sikmac3:remuz@localhost/TestFolder"]; CFURLRef urlRef; urlRef = (CFURLRef) url; Boolean test
NSURL * url;
SInt32 status = 0;
url = [[NSURL alloc] initWithString:@"ftp://sikmac3:remuz@localhost/TestFolder"];
CFURLRef urlRef;
urlRef = (CFURLRef) url;
Boolean test = CFURLDestroyResource(urlRef, &status);
if(test){ NSLog(@"deletion success"); }else{ NSLog(@"deletion failed"); }
你的代码对我有用 试试这个:
url= [[NSURL alloc] initWithString:@"ftp://sikmac3:remuz@localhost/TestFolder/"];
^
文件和文件夹几乎相同,但在文件夹末尾添加一个/
。仅此而已。您的代码对我适用 试试这个:
url= [[NSURL alloc] initWithString:@"ftp://sikmac3:remuz@localhost/TestFolder/"];
^
文件和文件夹几乎相同,但在文件夹末尾添加一个/
。就这些