Scenario 1 . I used this code to download files from Dropbox using the Dropbox SDK.
-(void)downloadFile:(DBMetadata*)file
{
if (!file.isDirectory)
{
NSString *documentsPath = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0];
NSString *localPath = [documentsPath stringByAppendingPathComponent:file.filename];
[[self restClientForDownload] loadFile:file.path intoPath:localPath];
}
}
Scenario 2. Whenever I want to play songs from the Documents directory. It will not play when the iPhone receives a password locked. The current song also stopped in a split second.
source
share