• 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: pb with awakeFromNib
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: pb with awakeFromNib


  • Subject: Re: pb with awakeFromNib
  • From: "julien ricard" <email@hidden>
  • Date: Tue, 19 Jun 2007 15:58:27 +0200

On 6/19/07, Fritz Anderson <email@hidden> wrote:
On 19 Jun 2007, at 5:59 AM, julien ricard wrote:

> I want to launch a quite long process automatically when my cocoa
> application is opened. I launch it in awakeFromNib, but the window
> does not open before my process is finished. I'd like my application
> to be usable while that process is running. How can I do it?

I'd like more detail.

How are you running the process? Through NSTask?

yes, I'm using NSTask to launch a binary that analyses tracks from itunes (which takes a while). My application is a kind of extension for itunes to create playlists. When launched, it detects songs that have been removed or added in itunes library since last time it was used and, respectively, delete or add data in a text file.


If NSTask, I assume you are not sending -waitUntilExit?

I do send waitUntilExit, because I thought awakeFromNib would execute once the interface is ready and shown.

How, if at all, are you dealing with stdout and stderr?

I presume the process does something necessary to the running of your
program. What does your program do before the necessary thing has
been done?

As an aside: I am leery of performing one-shot actions in
awakeFromNib, if it can be helped at all. An owner of NIBs gets this
message whenever any of its NIBs gets (re)loaded. I've found it easy
to add a NIB to a class, and forget that I've just bought an extra
call to awakeFromNib. See if it's a good idea to move your launch to
applicationWillFinishLaunching: or applicationDidFinishLaunching: .

        — F


_______________________________________________

Cocoa-dev mailing list (email@hidden)

Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >pb with awakeFromNib (From: "julien ricard" <email@hidden>)
 >Re: pb with awakeFromNib (From: Fritz Anderson <email@hidden>)

  • Prev by Date: Re: making a screen dump app
  • Next by Date: Re: Register for AC power change
  • Previous by thread: Re: pb with awakeFromNib
  • Next by thread: Re: pb with awakeFromNib
  • Index(es):
    • Date
    • Thread