Objective C is displaying data in UITextView

I am having difficulty displaying data in a UITextView on an iPhone.

I am analyzing incoming audio data (from microphone). To do this, I create an analyzer object from my SignalAnalyzer class that analyzes the incoming data. I would like to do this in order to display each new incoming information in the TextView in real time.

So when I click the button, I create a parser object that parses the input. Every time new data comes in, I need to display it on screen in a TextView.

My problem is that I am getting an error because (I think) I am trying to send a message to the parent class (the one who cares about displaying stuff in my UITextView: it has a UITexView instance variable associated with the Interface Builder). What should I do to tell the parent class what it needs to display? Or how should I create my classes to display anything automatically?

Thank you for your help.

PS: Here is my mistake:

    2010-04-19 14:59:39.360 MyApp[1421:5003] void WebThreadLockFromAnyThread(), 
0x14a890: Obtaining the web lock from a thread other than the main thread 
or the web thread. UIKit should not be called from a secondary thread.

    2010-04-19 14:59:39.369 MyApp[1421:5003] bool _WebTryThreadLock(bool), 
0x14a890: Tried to obtain the web lock from a thread other than the main thread 
or the web thread. This may be a result of calling to UIKit from a secondary thread.
Crashing now...

    Program received signal:  "EXC_BAD_ACCESS".

      

+2


a source to share


1 answer


It looks like your problem is that you are trying to update the UI from a secondary thread, which you are not allowed to do. Explore usage performSelectorOnMainThread:

to update your user interfaces.



+5


a source







All Articles