Ok couple of things. When you press the button , you are triggering
- (void)startPB; Which does different things. In fact it is making the progress run by doing [self.piRunning startAnimation:self];
Technically this isn't called anywhere else so I'm not sure why you expected it to be animating, since nothing else seems to call -startPB.
startPB is called from within the processFile routine. The processFile routine is called when you click the button (line 188) or when files are dropped (line 125). The only difference between the two calls is that the one from the drop will iterate through all of the files dropped and call this routine for each one (normal testing is using only one file); the other one is called when the button is pressed using a hard coded test file.
The most obvious thing to me was to try to call that in something like - (BOOL)performDragOperation: HOWEVER that didn't work.
Nah, I don't call this, it gets called automatically when drag operations are going on. The whole drag and drop section is almost directly copied from Apple's example code.
Took me a while to decide to try to log out the NSProgressBar object. SURPRISE it is nil.
I should have thought to look at that, but why would it be NIL when performing the drop but not when getting the button click? Very odd behavior.
Some curious things going on. You're treating a view as if it is a view controller. So I decided to NSLog out self in those two methods... SURPRISE again self (aka the view) are two different views, one of which has a NSProgressBar and one which clearly does not.
This has to be the source of the problem.. hmm... not sure why there would be two views . . . I'll look into this more. Thanks.
----------
First, be patient. You're posting to a forum where people come an go at their pace, not yours. 15.5 hours is a short time to expect someone to actually go look at your code sample. Most of the time I refuse to do that. Today while at work I saw your post, but couldn't return to it until late tonight. Anyway...
Yeah, I know. Sorry, been banging my head against a wall on this for quite some time now.
🙁 If I can get this one thing to work, everything will be working the way I want it to . . . besides features yet to come.
I found it interesting that you are potentially calling starPB multiple times but keep using the same runTimer object. When the first stopPB call gets called, it will affect the last runTimer setup. So I suppose you could be stopping later timers and therefore you animation. If you are stopping a later timer, then the earlier ones will continue to run forever. I think you only want one timer.
True, but this is more of a function of the sample code then the real code. The real code will verify that one process is done before the next one begins. The push button is just for me to debug stuff with, but I left it in as an example of working the way I want it to work.
In the sample code, sysCmd isn't setup anywhere, so you are hiding some valuable information from us. If you are doing the same thing with sysCmd as you are with runTimer, then again, that may be an issue. Say that latest sysCmd finishes before earlier ones, then the stopPB gets called and ends the animation.
sysCmd is never used in this sample code yet the code shows the same issues as the code that does use it. I removed everything that wasn't necessary to seeing the problem; no need to have to wade through hundreds of other lines of code.
In the context given, timerTimeout doesn't make sense to me. Just increase the time for the timer instead. For each new pass through startPB you do reset it to zero, but after that last reset and after incrementing greater than 10, it will aways pass the test in the updateTimer: method.
I see NSProgressIndicator has a method named setUsesThreadedAnimation: which might be helpful to you. Although I suspect other problems as mentioned above.
Yeah, been through that, didn't seem to make a difference. I'm guessing it has to do with the multiple views that Jared saw. I bet that's the root cause.
Thanks guys, at least now I have some ideas where to start looking.
Dave