Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

iphonemobdev

macrumors newbie
Original poster
Jan 29, 2010
15
0
Hi ,
i am downloading an mp3 file using NSURLConnection and saving it to a file . The problem is mp3 file is created (found the mp3 file created when using simulator), but i cannot access the mp3 file . Any ideas?!!!!!


This is the code i'm using

filename = [[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0] stringByAppendingPathComponent:save_name];
[[NSFileManager defaultManager] createFileAtPath:filename contents:nil attributes:nil];

file = [[NSFileHandle fileHandleForUpdatingAtPath:filename] retain];// file is in .h

}

if (file) {

[file seekToEndOfFile];


} [file writeData:data];
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.