views:

49

answers:

1

I am trying to develop an application which downloads online music data (music files) and makes them available when I am offline.

Can anyone help me? What is the best way to do that?

+4  A: 

I like ASIHTTPRequest framework for downloading. You may also use standard NSURLRequest, but as for me it's not as easy-to-use as ASIHTTPRequest.

Update: To save file, you may use Documents directory:

NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSFileManager *fileManager = [NSFileManager defaultManager];
NSString *documentsDirectory = [paths objectAtIndex:0];

To save loaded data into a file, use

- (BOOL)writeToFile:(NSString *)path atomically:(BOOL)flag

To load:

+ (id)dataWithContentsOfFile:(NSString *)path
kovpas
thank you sir i am trying to implement this .I hope u will help me if i get any error in this code
Feel free to ask.
kovpas