FROM : Julio Bianco
DATE : Mon Jun 05 22:04:49 2006
Hi,
I'm trying to write son dictionary information in a file, and I
realize that I can do it using the method
- (BOOL)writeToFile:(NSString *)path atomically:(BOOL)flag
and I use it like this:
+(TCLogger *) instance {
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
NSDictionary *LogFile1 = [[NSDictionary alloc] initWithObjectsAndKeys:
@"one", [NSNumber numberWithInt: 1],
nil];
if ([LogFile1 writeToFile: @"/Users/jbianco/pueba.log" atomically:
YES])
NSLog(@"escribio el archivo2");
if ([LogFile1 writeToFile: [NSHomeDirectory()
stringByAppendingPathComponent: @"Desktop/log.conf"] atomically: YES])
NSLog(@"escribio el archivo");
[LogFile1 release];
[pool release];
return instance;
}
and when I try to run it, that is not run Ok, because never prints
those logs, and neither creates the file.
Can you tell me what am I doing bad?
Thanks
Julio
DATE : Mon Jun 05 22:04:49 2006
Hi,
I'm trying to write son dictionary information in a file, and I
realize that I can do it using the method
- (BOOL)writeToFile:(NSString *)path atomically:(BOOL)flag
and I use it like this:
+(TCLogger *) instance {
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
NSDictionary *LogFile1 = [[NSDictionary alloc] initWithObjectsAndKeys:
@"one", [NSNumber numberWithInt: 1],
nil];
if ([LogFile1 writeToFile: @"/Users/jbianco/pueba.log" atomically:
YES])
NSLog(@"escribio el archivo2");
if ([LogFile1 writeToFile: [NSHomeDirectory()
stringByAppendingPathComponent: @"Desktop/log.conf"] atomically: YES])
NSLog(@"escribio el archivo");
[LogFile1 release];
[pool release];
return instance;
}
and when I try to run it, that is not run Ok, because never prints
those logs, and neither creates the file.
Can you tell me what am I doing bad?
Thanks
Julio
| Related mails | Author | Date |
|---|---|---|
| Julio Bianco | Jun 5, 22:04 | |
| Nick Kreeger | Jun 5, 23:40 | |
| Michael Ash | Jun 6, 01:08 | |
| Julio Bianco | Jun 6, 16:07 | |
| j o a r | Jun 6, 16:17 |






Cocoa mail archive

