• 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: Two problems trying to use NSTextView for a scrolling console/terminal like view
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Two problems trying to use NSTextView for a scrolling console/terminal like view


  • Subject: Re: Two problems trying to use NSTextView for a scrolling console/terminal like view
  • From: Eric Wing <email@hidden>
  • Date: Sat, 28 Dec 2013 22:11:54 -0800

On 12/28/13, Jerry Krinock <email@hidden> wrote:
>
> On 2013 Dec 28, at 15:14, Eric Wing <email@hidden> wrote:
>
>> 1) I figured out that the bottleneck was in scrollRangeToVisible call.
>
> You could see if you have better luck with -[NSView scrollPoint:].
>
>> 2) -[NSBigMutableString replaceCharactersInRange:withString:]: nil
>> argument
>
> Well, there’s the obvious answer that your other code is passing nil for
> withString:.  You could check for that.
>

Thanks Jerry. You were spot on with both answers. scrollPoint is a lot
faster and can handle the large data sets (though it is not as
accurate, but I don't care).

And I was indeed passing nil. The end of my data run contained funny
characters or null characters in the byte stream so my NSString
initWithBytes:length: encoding:NSUTF8StringEncoding was failing
despite giving a length. I had wrongly assumed I was hitting some size
limit in this case since my test had run fine for the first hour and
it was painful to retest since this takes a few hours.

But I did notice a new problem. At around 800,000 lines, the
NSTextView stops displaying new appended text. Strangely, if I do a
Cmd-A, Cmd-C, and then paste to another program, I do get all the
data. So the data exists, but it NSTextView is not displaying it
correctly. I'll chalk this up to a OS X bug and move on though.


Thanks,
Eric
--
Beginning iPhone Games Development
http://playcontrol.net/iphonegamebook/

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden


  • Follow-Ups:
    • Re: Two problems trying to use NSTextView for a scrolling console/terminal like view
      • From: Jens Alfke <email@hidden>
References: 
 >Two problems trying to use NSTextView for a scrolling console/terminal like view (From: Eric Wing <email@hidden>)
 >Re: Two problems trying to use NSTextView for a scrolling console/terminal like view (From: Jerry Krinock <email@hidden>)

  • Prev by Date: Re: Keep sibling view in Responder Chain
  • Next by Date: Re: Two problems trying to use NSTextView for a scrolling console/terminal like view
  • Previous by thread: Re: Two problems trying to use NSTextView for a scrolling console/terminal like view
  • Next by thread: Re: Two problems trying to use NSTextView for a scrolling console/terminal like view
  • Index(es):
    • Date
    • Thread