[英]How do I load the contents of a file that resides in my app folder?
Using the loadFile
selector and the loadedFile
delegate selector, how do I read the contents of a file which is in my application's app folder on dropbox? 使用
loadFile
选择器和loadedFile
委托选择器,如何读取loadedFile
箱上应用程序的应用程序文件夹中文件的内容?
Are you supposed to loadFile: intoPath:
and specify an absolute path on the disk (like a tmp folder?) from which you actually read the contents after the loadedFile
delegate method is called? 您是否应该将
loadFile: intoPath:
并指定磁盘上的绝对路径(如tmp文件夹?),然后从该路径中实际读取内容,然后loadedFile
委托方法?
Does the Dropbox IOS/OSX SDK automatically determine if the file is stored locally in the users' dropbox folder, and is at the current version, before fetching and downloading the file? 在提取和下载文件之前,Dropbox IOS / OSX SDK是否会自动确定文件是否存储在用户的dropbox文件夹中,并且是否为当前版本?
Am I missing something here? 我在这里想念什么吗? Or is this the intended implementation?
还是这是预期的实现?
Sorry for the newbish question, it just doesn't seem like there's a ton of concrete documentation on how to actually use this method. 对这个新问题很抱歉,似乎没有关于如何实际使用此方法的大量具体文档。
When I say I'd like to load the contents of the file, I want to dump the file contents into an NSString
object. 当我说我想加载文件的内容时,我想将文件内容转储到
NSString
对象中。 Sorry if that wasn't clear. 很抱歉,如果不清楚。
NSMutableArray *tempArray =[NSMutableArray arrayWithArray:[[NSFileManager defaultManager] contentsOfDirectoryAtPath:directoryPath error:Nil]];
NSFileManager *fileManager =[NSFileManager defaultManager];
NSString path = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
path=[path stringByAppendingPathComponent:@"filename with extension"];
Now you can use path variable for loading file. 现在,您可以使用路径变量来加载文件。
Have a happy Coding.!! 祝您编码愉快!!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.