ios - Is it possible to store a music file in iPhone local storage? -
i making iphone app in user can listen stories present on web server.
now want download audio story file local iphone memory on download button click.
i downloading file webserver file saving somewhere else, not in phone memory. 1 know how can store file in iphone memory, not in application document memory?
i think links idea document directory
here sample code snippet
nsstring *filepath = [[self applicationdocumentsdirectory].path stringbyappendingpathcomponent:@"filename.caf"]; [filedata writetofile:filepath atomically:yes ]; - (nsurl *)applicationdocumentsdirectory { return [[[nsfilemanager defaultmanager] urlsfordirectory:nsdocumentdirectory indomains:nsuserdomainmask] lastobject]; }
Comments
Post a Comment