Re: sequencer from callback
Re: sequencer from callback
- Subject: Re: sequencer from callback
- From: Aran Mulholland <email@hidden>
- Date: Thu, 17 Feb 2011 09:35:56 +1100
I won't comment on your methods, however the fix for your problem is that you are calling setNeedsDisplay from a background thread. Try:
[yourUiObject performSelectorOnMainThread:@selector(setNeedsDisplay) waitUntilDone:NO]
the ui methods won't work (at best) from a background thread, at worst you'll just get some weird crash.
On Thu, Feb 17, 2011 at 2:59 AM,
<email@hidden> wrote:
Hi everybody,
for a sequencer I am using a callback function to calculate
timing events, changing the value of a objective c variable
in certain time intervals. I tried using the accessor methods
of the variable to announce changes of the variable to the part
of my app that displays the sequencer. So everytime
the value of the variable is changed, the setter method is called,
which works just fine if I for example just printf the values.
But if I try to refresh a view by calling setNeedsDisplay from the
setter its just not working, the view doesn't refresh (refreshing like this works fine from other contexts).
Could it be that I shouldn't call the setter method from within the callback function (I know its a bad idea to call objective c methods inside a callback)? Is the callback context suppressing the setNeedsDisplay?
If yes, is there another way to keep track of changes of a variable, like some kind of listener which calls a method every time the variable changes?
I already tried a timer for refreshing but that slows everything down big time.
Does anyone have experience with tasks like this?
Would be really nice to get some help here.
Greetings,
Michael
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden