开发者

iPad App became crashed when use CFURLDestroyResource

开发者 https://www.devze.com 2023-01-29 09:51 出处:网络
I use this code to delete file by FTP Connection url = [[NSURL alloc] initWithString:@\"ftp://sikmac3:remuza@localhost/Test.php\"];

I use this code to delete file by FTP Connection

url = [[NSURL alloc] initWithString:@"ftp://sikmac3:remuza@localhost/Test.php"];
CFURLRef urlRef;
urlRef = (CFURLRef) url;
Boolean test = CFURLDestroyResource(urlRef, status);
if(test){
    NSLog(@"deletion success");
}else{
    NSLog(@"deletion failed");
}

CFRelease(urlRef);
[url release];

the file was deleted. but application became crashed/ terminated immediately.

Any one know about this case. How can I 开发者_如何学运维solve this problem?


Try this code instead:

SInt32 status = 0;
Boolean test = CFURLDestroyResource(urlRef, &status);

You must pass a pointer to a valid SInt32 where the function can return the result.

0

精彩评论

暂无评论...
验证码 换一张
取 消