2010-02-04 1 views
1

NSURLConnection을 사용하여 mp3 파일을 다운로드하고 파일에 저장하고 있습니다. 문제는 mp3 파일이 생성되었지만 (시뮬레이터를 사용할 때 생성 된 mp3 파일을 찾았습니다.) mp3 파일에 액세스 할 수 없습니다. 어떤 아이디어? !!!!! NSFileHandle iphone의 이상한 문제

은 당신이 그것에 작성 후 파일을 닫아야처럼 내가

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]; 

답변

1

이 보이는 사용하고 코드입니다.

[fileHandle closeFile];