• 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: Stéphane Sudre <email@hidden>
  • Date: Wed, 13 Aug 2003 08:53:26 +0200

You need to get the "real" path by using:

stringByExpandingTildeInPath

on your thePath parameter.

On mercredi, ao{t 13, 2003, at 08:37 AM, April Gendill wrote:

I am trying to save a file to the home folder automatically.
Mostly because I'm not having any luck reading and writing to the main
bundle.
anyway.
this is the Method I'm using but it does not write anything . If I
change the path to just the root directory it works, but not if I try
to write to the home folder or anywhere else. the method is in test
mode right now, but later there will be actual data written.

- (void)saveFile:(id)sender
{
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?
_______________________________________________
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.
_______________________________________________
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: 
 >Saving to the home folder (From: April Gendill <email@hidden>)

  • Prev by Date: Re: ScreenSaver with a subview won't preview
  • Next by Date: Re: Saving to the home folder
  • Previous by thread: Saving to the home folder
  • Next by thread: Re: Saving to the home folder
  • Index(es):
    • Date
    • Thread