我在我的應用程序中集成了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