문제가 있습니다. 파일에 데이터를 저장하기위한 아래 코드가 있습니다. 기기에 내 앱을 만들고 실행합니다. 결과 변수는 TRUE이지만 내 iPhone 장치에서 파일을 찾지 못합니다. 도와 주시겠습니까? 장치에 내 영어 XPiPhone에서 로그 파일 찾기
-(void)saveXML:(NSString*)name:(float)x:(float)y:(float)z{
NSMutableData *data = [NSMutableData data];
NSKeyedArchiver *archiver = [[NSKeyedArchiver alloc] initForWritingWithMutableData:data];
[archiver setOutputFormat:NSPropertyListXMLFormat_v1_0];
[archiver encodeFloat:x forKey:@"x"];
[archiver encodeFloat:y forKey:@"y"];
[archiver encodeFloat:z forKey:@"z"];
[archiver encodeObject:name forKey:@"name"];
[archiver finishEncoding];
NSString* filePath = [[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0] stringByAppendingPathComponent:@"XML Position"];
BOOL result = [data writeToFile:filePath atomically:YES];
if(result)
[self updateTextView:@"success"];
[archiver release];
}
가능한 [saveToFile 문제] (http://stackoverflow.com/questions/2934368/problem-with-savetofile) – kennytm
다른 질문입니다. – zp26