我在我的应用程序中集成了Dropbox。我已经将它显示给用户,他们可以选择要下载的文件。我知道我需要调用这一行,但我不知道iPhone上的本地文件路径是什么。它只需要是临时的,因为一旦我有文本文件,我会处理它...我的问题是什么是本地文件路径。先谢谢你。iPhone本地文件路径
[[self restClient] loadFile:[filePaths objectAtIndex:indexPath.row] intoPath:localPath]
更新根据回答波纹管:::仍然没有工作
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
NSString *localPath = [[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0] stringByAppendingString:[filePaths objectAtIndex:indexPath.row]];
[[self restClient] loadFile:[filePaths objectAtIndex:indexPath.row] intoPath:localPath];
NSLog(@"%@",[NSString stringWithContentsOfFile:localPath encoding:NSUTF8StringEncoding error:nil]);
}
终止应用程序由于未捕获的异常“NSInvalidArgumentException”,原因:“*** - [NSPathStore2 stringByAppendingString:]:无参数” – BDGapps
看看我如何使用它上面... – BDGapps
你确定' [filePaths objectAtIndex:indexPath.row]'不是null? – Sebrassi