Re: NSApplication
Re: NSApplication
- Subject: Re: NSApplication
- From: Chris Hanson <email@hidden>
- Date: Wed, 26 Nov 2003 19:31:28 -0600
On Nov 26, 2003, at 4:18 PM, Brian Dent wrote:
can someone plz show me how to use an applicationdidfinishlaunching to
display a progress bar in a panel.
You need to register some object as the application's delegate.
Typically the File's Owner of the MainMenu.nib file is the instance of
NSApplication used by the application, so you can just set its delegate
in Interface Builder to be your application controller.
If the application's delegate implements a method named
"applicationDidFinishLaunching" that takes an NSNotification as its
single parameter, this method will be called once the application is
done launching. There you can do something like load a nib file
containing a window and a progress bar, which can have its value bound
to a property of its File's Owner. In your time-consuming process,
just change the value of this property using the standard Key-Value
Coding method setValueForKey (rather than changing it directly) and the
progress bar will see the updates.
(Note that because I'm talking about bindings, the above will only work
on 10.3 and later. For 10.2 and later, you'll have to have an outlet
to the progress bar and set its value directly -- not hard at all, once
you understand Cocoa.)
i need it in a cocoa-JAVA app, i dont want told to look at the c docs,
i dont know c, i have never used c.
It's not C, it's Objective-C. There's a difference; Objective-C has
object-oriented extensions that Cocoa relies upon. But to understand
Objective-C, you need to have an understanding of C.
i am building it in project builder, with interface builder, so i cant
look at anything but what i have written myself.
why is it so hard to find help with using java!!!!
Objective-C is Cocoa's native language. It's what the vast majority of
people doing Cocoa development use, and to be able to fully understand
Cocoa you need to understand Objective-C well enough to at least read
it. (That way you can read the large amount of sample code and
documentation available.)
The other reason you might be having trouble finding help is that your
question appears to be less of a question and more of a demand: "Please
write this code for me!" Sorry, but writing code for people is what I
do professionally (more info on my web site). You probably won't learn
much either if someone just writes it for you. Hopefully with the
above I've given you enough background that you can start doing some
research so you'll be able to figure it out on your own, and
significantly advance your understanding of Cocoa. I think you'll be
much better off in the long run that way.
-- Chris
--
Chris Hanson <email@hidden>
bDistributed.com, Inc.
Outsourcing Vendor Evaluation
Custom Mac OS X Development
Cocoa Developer Training
_______________________________________________
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.