需要帮助Cydia App Root权限 [英] Need help Cydia App Root Rights
问题描述
我试图用ASIHTPP下载文件。我试过我的越狱Ipad,看到代码下载文件,但没有在Documet文件夹。那怎么了?
在Xcode不是一个错误只有一个警告说,documtensdirectory一个未使用的变量是。
i tried to download a File with ASIHTPP. I tried on my jailbroken Ipad and see that the Code download a File but no in the Documet Folder. So what is wrong? In Xcode is not a Error only a Warning that the documtensdirectory a unused variable is.
- (IBAction)grabURLInBackground:(id)sender
{
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
NSURL *url = [NSURL URLWithString:@" http://db.tt/5WP2pia"];
ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:url];
[request setDownloadDestinationPath:@"/var/root/osk.rar"]
[request setDelegate:self];
[request startAsynchronous];
}
推荐答案
将文档文件夹设置为目标路径。您需要在文档文件夹中指定一个文件名作为下载路径,使其正常工作:
You are setting the documents folder as destination path. You need to specify a file name inside the documents folder as download path like this to make it work:
[request setDownloadDestinationPath:[documentsDirectory stringByAppendingPathComponent:@"myfile.extension"]];
将下载的数据保存在文件 myfile.extension
在文件夹中。
This saves the downloaded data in the file myfile.extension
inside the documents folder.
您还应设置一个临时下载路径,否则下载的字节存储在内存中,直到下载完成,而不是在文件。
You should also set a temporary download path, otherwise the downloaded bytes get stored in the memory until the download is finished rather than in a file.
这篇关于需要帮助Cydia App Root权限的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!