iphone network multithreading
<p>I have a class for receiving data from network,named NetWorkConnect.the following method is in NetWorkConnect.m,this is delegate method. m_DisplayMarketViewController is an instance of class DisplayMarketViewController.</p>

<pre><code>-(void)stream:(NSStream*)stream handleEvent:(NSStreamEvent)eventCode{
    switch (eventCode) {
        case NSStreamEventHasBytesAvailable:
        {
            if (data == nil) {
            data = [[NSMutableData alloc] init];
            }
            uint8_t buf[1024];
            unsigned int len = 0;
            len = [(NSInputStream *)stream read:buf maxLength:1024];
            if(len) {    
            [data appendBytes:(const void *)buf length:len];
            } else {
            NSLog(@"No data.");
            }  
           [self storeData:data];              
           [m_DisplayMarketViewController updateMarket:self];                   
    } break;  
    default:
      break;
    }
}
</code></pre>

<p>the method updateMarket passes the self to DisplayMarketViewController,so DisplayMarketViewController can use the data which received from network.and in DisplayMarketViewController.m file the data will be displayed.but when I update the data,i can display the data ,but the  inteface seems a little blocked,so I intend to use multiThreading....but how to do it?thank you.</p>
