I would like to add a NSProgressIndicator
.
I have a button which enable a timer, then after the delay, a method is called.
I would like to start the spinning animation when I press the button, and I would like to stop animation when the method ends.
So, in my .h
I added
NSProgressIndicator * ConnectingProgress;
Then in my .m
in my button action I added
[ConnectingProgress startAnimation:sender];
And for last at the end of my method I added
[ConnectingProgress stopAnimation:sender];
The issues:
- the "sender" is not recognized in my method.
- nothing work, also the startAnimation...
What I did wrong and How can I passtrhough?
The compiler is saying you that you don't have any local variable
sender
. Passself
(a view controller reference) directly or declaresender
asand
What's the reason to declare a
NSProgressIndicator
variableConnectingProgress
starting with a capital C ? The capital starting letters are used for class, categories, etc. names, useconnectingProgress
instead.I hope the
connectingProgress
is initialized somewhere (probably atviewDidLoad
) and added as a subView somewhere.