iPad App became crashed when use CFURLDestroyResource
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.
精彩评论