• 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: Saving to the home folder
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Saving to the home folder


  • Subject: Re: Saving to the home folder
  • From: Nicholas Riley <email@hidden>
  • Date: Wed, 13 Aug 2003 02:10:38 -0500
  • Mail-followup-to: April Gendill <email@hidden>, email@hidden

On Tue, Aug 12, 2003 at 11:37:44PM -0700, April Gendill wrote:
> NSString *thePath=@"~/testFile.dict";
> NSMutableDictionary *theDict =[[NSMutableDictionary
> alloc]init];
> [theDict setObject:@"Value" forKey:@"Key"];
> [theDict writeToFile:thePath
> atomically:YES];

> I use a performSelector call to invoke this, although in the end it
> will probably be -(void)saveFile:(NSDictionary *)aDictionary
> so I can call it simply with [self saveFile]; Anyway. I must assume
> that the way I'm entering the path is incorrect. So how do I get it to
> write to the home folder?

You need to use [thePath stringByExpandingTildeInPath]. ~ is just a
shortcut and is not valid to the low-level file utilities.

--
=Nicholas Riley <email@hidden> | <http://www.uiuc.edu/ph/www/njriley>
Pablo Research Group, Department of Computer Science and
Medical Scholars Program, University of Illinois at Urbana-Champaign
_______________________________________________
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.

  • Follow-Ups:
    • Re: Saving to the home folder
      • From: April Gendill <email@hidden>
References: 
 >Saving to the home folder (From: April Gendill <email@hidden>)

  • Prev by Date: Re: Saving to the home folder
  • Next by Date: nspopupbutton with same menu
  • Previous by thread: Re: Saving to the home folder
  • Next by thread: Re: Saving to the home folder
  • Index(es):
    • Date
    • Thread