• 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
Re: writeToFile:
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: writeToFile:


  • Subject: Re: writeToFile:
  • From: Andreas Mayer <email@hidden>
  • Date: Mon, 17 Feb 2003 23:03:16 +0100

Am Montag, 17.02.03 um 22:03 Uhr schrieb Hussain Bandukwala:

Is it even possible to write a dictionary to a .txt file? Am I missing something? Any other suggestions for doing what I need to do?

Well, what about some debugging on your own?

// creating path
blockListDictPath = [[NSBundle mainBundle] pathForResource:@"BlockedDevicesList" ofType:@"txt"];

Check, if this method returns a valid path.

// creating dictionary
blockedDirectory = [NSDictionary dictionaryWithObject: connectToDevice forKey: deviceName];

Check if the dictionary is valid.

// calling writeToFile
if ([blockedDirectory writeToFile:blockListDictPath atomically:YES])
{NSLog(@"Success Writing to File");}
else
{NSLog(@"Failure Writing to File");}

Try to write something else (for example with NSString writeToFile) to that destination.

As far as I know there is no restriction to the file types you can write with NSDictionary's writeToFile:atomically:.


bye. Andreas.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >writeToFile: (From: "Hussain Bandukwala" <email@hidden>)

  • Prev by Date: _newFirstResponderAfterResigining ???
  • Next by Date: Re: Protecting singleton objects from releasing
  • Previous by thread: Re: writeToFile:
  • Next by thread: Restricting an NSSplitView when Resizing a Window
  • Index(es):
    • Date
    • Thread