• 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: App behaves differently when run in Xcode
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: App behaves differently when run in Xcode


  • Subject: Re: App behaves differently when run in Xcode
  • From: Sherm Pendley <email@hidden>
  • Date: Fri, 28 Oct 2005 03:15:07 -0400

On Oct 28, 2005, at 2:21 AM, Victor Tran wrote:

The problem is when I try to run the Hawk.app file
(after deployment) in the build folder it doesn't
do any of the logging it's supposed to do.

Anyone have any ideas why it's doing this?

How is it determining where to write the logs? Are you specifying the full path to the log file, or just the file name?

I specified the path and filename. e.g. "./logs/imageTest.png"

I suspected something like that, which is why I asked - that's not the full path to the file.


The "." is the current working directory, which will be different depending on how your app is launched. When it's launched from Xcode, it's the build directory. When it's launched from Finder, it's "/". When it's launched with the "open" command-line tool, it's inherited from whatever process ran that. In other words, you can't depend on it having any particular value.

Here's how to get the full path to the current user's recommended log directory:

NSString *logDir = [@"~/Library/Logs/MyApp" stringByExpandingTildeInPath];

Note that the standard place for logs is under either ~/Library/Logs or /Library/Logs, depending on whether they're shared among multiple users. Even if the current directory were reliable, creating a logs/ directory next to the .app would be a bad idea for other reasons anyway.

sherm--

Cocoa programming in Perl: http://camelbones.sourceforge.net
Hire me! My resume: http://www.dot-app.org

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: App behaves differently when run in Xcode
      • From: Victor Tran <email@hidden>
References: 
 >Re: App behaves differently when run in Xcode (From: Victor Tran <email@hidden>)

  • Prev by Date: time-triggered-function
  • Next by Date: Re: time-triggered-function
  • Previous by thread: Re: App behaves differently when run in Xcode
  • Next by thread: Re: App behaves differently when run in Xcode
  • Index(es):
    • Date
    • Thread