Looking for the log file on iPhone
        Posted  
        
            by zp26
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by zp26
        
        
        
        Published on 2010-05-29T09:15:38Z
        Indexed on 
            2010/05/29
            9:22 UTC
        
        
        Read the original article
        Hit count: 270
        
Hi, I have a problem. I have the code below for save a data on file. I build my app on the device, and run. The result variable is TRUE, but i don't find the file on the my iPhone device. Can you help me? Thank and sorry for my english XP
 -(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];
 }
        © Stack Overflow or respective owner