• 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: Very strange problem
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Very strange problem


  • Subject: Re: Very strange problem
  • From: Greg Titus <email@hidden>
  • Date: Thu, 18 Jul 2002 11:54:46 -0700

Hi Aidas,

How are you specifying the filename where you are saving your data?

If you are using a relative path (like just a filename "foo.data") instead of a fixed path ("/Users/aidas/foo.data"), that is most likely your problem.

When you run an application from Project Builder, the application's current directory is the location where the app executable is stored, but when you run an app from the Finder, the app's current directory is "/" (the root). So using relative paths for files will break.

You should put together a fixed path relative to the current user's home directory (by using the NSHomeDirectory() function) or relative to the application (by using [[NSBundle mainBundle] bundlePath]).

Hope this helps,
-Greg

On Thursday, July 18, 2002, at 06:55 AM, Aidas wrote:

Hello all,

I have a very strange problem. It may look stupid to you, but hey I'm
newbie.

Anyway here is my problem:
I'm creating a little application, it's a dictionary. I'm using
NSMutableArray to store my NSTableView(simple ListBox) data. My problem is
when I save NSTableView data and later I want to read it and put it into
NSTableView it works only first time and from ProjectBuilder when I click
"Debug>Run executable", but not when I run this application from Finder.

Thank you
_______________________________________________
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: 
 >Very strange problem (From: Aidas <email@hidden>)

  • Prev by Date: Re: OS 9 Extension...
  • Next by Date: Re: Using CVS
  • Previous by thread: Very strange problem
  • Next by thread: Collapsible Sections in Sheets
  • Index(es):
    • Date
    • Thread