NSProgressIndicator

Dogcow

Registered
I'm attempting to learn Cocoa programming and I've managed to stump myself...
I'm trying to use a ProgressIndicator and can't figure out how to get it to work:

IB won't let me have a button in my program activate the throbber since that button already does something else. So I've created an outlet from my program named "throbber" which is declared in my header file via: "IBOutlet NSProgressIndicator *throbber;" I tried activating it in my code with "[throbber startAnimation];" but when I click it when the program is running the compilers says:

Code:
2003-01-21 21:12:14.208 Prime Numbers[1463] *** -[NSProgressIndicator startAnimation]: selector not recognized

Also one weird thing... Though the spinwheel looks fine in IB, it shows up as a barbar pole when I build in ProjectBuilder. Plus it should be hidden until activated, but in PB it shows up right away. It still doesn't animate...just that error message.

Any suggestions?

Thanks in advance,
- Dogcow "moof!"
 
Do you have an alert while compiling that says :

Code:
NSProgressIndicator does not respond to -startAnimation:

That would mean NSProgressIndicator dosn't have a method called startAnimation. You may look at the class's documentation
 
Originally posted by Dogcow

... I tried activating it in my code with "[throbber startAnimation];" but when I click it when the program is running the compilers says:

Code:
2003-01-21 21:12:14.208 Prime Numbers[1463] *** -[NSProgressIndicator startAnimation]: selector not recognized


Dude, check startAnimation function syntax:

- (void)startAnimation: (id)sender

so you have to write:

[throbber startAnimation:SENDER];

SENDER is some id...
 
Originally posted by kainjow
I just use:

Code:
[throbber startAnimation:nil];

using nil as the sender. Works fine for me.

Sure, but anyway you have to use some parameter, even if nil.
 
Back
Top