• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Display NSStream Output
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Display NSStream Output


  • Subject: Re: Display NSStream Output
  • From: Frederick Cheung <email@hidden>
  • Date: Tue, 22 Feb 2005 16:56:39 +0000


On 22 Feb 2005, at 16:41, Adam wrote:

My app is a client connected to a server. It has its own socket class that is based on NSStream. Whenever the server has data available the run loop calls NSStreamEventHasBytesAvailable. I parse this data line by line and output it with NSLog(); A simple case statement causes all kinds of things in my app to happen. No problems. However, the problem I am running into is if I want to display the raw data to the user of the app in a NSTextView.

In high volume times 10+ lines a second can came across. The GUI of my app lags and there is nothing I have been able to do to stop it. I have tried putting the text directly into the textStorage I have tried replaceCharactersInRange:withString: I tried writing the data out to a text file and then reading it back into the NSTextView.

Do you have any advice on how to print this data to the user without it lagging my GUI? Do I need a separate thread?


How about not updating the text view every time the data comes in, but limit updates to say once or twice a second?


Fred

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Display NSStream Output (From: Adam <email@hidden>)

  • Prev by Date: Re: Why is copyWithZone: being called?
  • Next by Date: Re: Works on 10.3, not 10.2
  • Previous by thread: Display NSStream Output
  • Next by thread: kqueue for network volumes?
  • Index(es):
    • Date
    • Thread