iPhone에서 다음 코드를 사용하여 iPhone 프로젝트 리소스 폴더에 저장된 파일에 문자열을 쓰고 있습니다. 내가 그 데이터를 성공적으로 읽으려고 할 때, 비록 내가 그 어떤 오류도 내지 않는 그 aloso가 있지만 그 파일을 쓰지 않는 것을 쓰려고 할 때.문자열이 파일에 쓰여지고 있지 않습니다 - iPhone
수하십시오NSString *myString; //Assuume the string you want to write is this
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
NSString *path = [documentsDirectory stringByAppendingPathComponent:@"myfile.txt"];
[myString writeToFile:path atomically:YES];
누구 가이드 :
이
내 코드입니다.
누구든지 도움을받을 수 있습니다! – Shah
'writeToFile : atomically : encoding : error :'메서드를 사용해 보셨습니까? 오류를 리턴합니다. 도움이 될 수 있습니다. –
당신은 24 분 후에 대답을 기대하는 것보다 좀 더 환자가되어야합니다! writeToFile : atomically : encoding : error를 사용하여 어떤 오류 메시지를 다시 보았습니까? –