• 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/Opening Files - different under PB than with build of app
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Saving/Opening Files - different under PB than with build of app


  • Subject: Re: Saving/Opening Files - different under PB than with build of app
  • From: Jim Correia <email@hidden>
  • Date: Sat, 22 Dec 2001 21:28:20 -0500

At 9:15 PM -0500 12/22/01, John Nestor wrote:

I write a dictionary to file as follows: [theDictionary writeToFile:@"foo" atomically:YES]; The file "foo"
appears in my build folder along with the build.

I read it back in using: [theDictionary withContentsOfFile:@"foo"];

The file is intended to be read in automatically on app launch and saved automatically at termination.
The project is non document based

This works fine under PB. Also, FWIW examining "foo" with BBEdit shows what I expect.

However, when I launch the build instead of running under PB the file is not read in.

The working directory may not be the same under all situations. It is "/" when the Finder launches you (on current builds of X). You should compute the full path to the file and use that to open it.

Jim


  • Follow-Ups:
    • Re: Saving/Opening Files - different under PB than with build of app
      • From: Hampus Edvardsson <email@hidden>
References: 
 >Saving/Opening Files - different under PB than with build of app (From: John Nestor <email@hidden>)

  • Prev by Date: Re: Saving/Opening Files - different under PB than with build of app
  • Next by Date: Re: NSBitmapImageRep, precomputing alpha
  • Previous by thread: Re: Saving/Opening Files - different under PB than with build of app
  • Next by thread: Re: Saving/Opening Files - different under PB than with build of app
  • Index(es):
    • Date
    • Thread