开发者

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.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜