• 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: Victor Tran <email@hidden>
  • Date: Fri, 28 Oct 2005 17:49:59 +1000 (EST)

--- Sherm Pendley <email@hidden> wrote:

> 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.
>

Hmm ok I'll try using the full path. The logs I'm
talking about are the actual outputs of the
application. So how do I get the current working
directory of the app?

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




____________________________________________________
Do you Yahoo!?
The New Yahoo! Movies: Check out the Latest Trailers, Premiere Photos and full Actor Database.
http://au.movies.yahoo.com
 _______________________________________________
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: Sherm Pendley <email@hidden>
References: 
 >Re: App behaves differently when run in Xcode (From: Sherm Pendley <email@hidden>)

  • Prev by Date: Re: [NSApp mainMenu] returns nil
  • Next by Date: Refreshing superview
  • 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