• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
How to write a dictionary into an output file
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How to write a dictionary into an output file


  • Subject: How to write a dictionary into an output file
  • From: Julio Bianco <email@hidden>
  • Date: Mon, 5 Jun 2006 17:04:49 -0300

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
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: How to write a dictionary into an output file
      • From: "Michael Ash" <email@hidden>
    • Re: How to write a dictionary into an output file
      • From: "Nick Kreeger" <email@hidden>
  • Prev by Date: Re: Creating mock of a class object
  • Next by Date: Re: no rule to process file
  • Previous by thread: Re: Auto sizing and locating
  • Next by thread: Re: How to write a dictionary into an output file
  • Index(es):
    • Date
    • Thread