• 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: Crash while adding to NSTextView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Crash while adding to NSTextView


  • Subject: Re: Crash while adding to NSTextView
  • From: Mark Allan <email@hidden>
  • Date: Thu, 3 Feb 2011 01:01:37 +0000

On 3 Feb 2011, at 00:36, Kyle Sluder wrote:
> On Wed, Feb 2, 2011 at 4:12 PM, Mark Allan <email@hidden> wrote:
>>        [consoleTextView replaceCharactersInRange:endRange withString:newText]; /**/ crashes here
>
> You didn't call -shouldChangeTextInRange:replacementString: first, or
> call -didChangeText when you were done.
>
> When working with the text system, it's important to remember to check
> both the NSText and NSTextView documentation. The text system is quite
> possibly the most confusing part of Cocoa.

Thanks very much, Kyle.  I'll go back and read the documentation again - properly this time!  I assumed that the "shouldChangeTextInRange" delegate method was something called automatically by the AppKit framework and that I didn't have to worry about it.  Apple's sample code ('log' method on the URL below) on the developer documentation website doesn't have those calls either, so that pretty much cemented my misunderstanding.
	http://tinyurl.com/BaseWindowController-m

Thanks again for setting me straight.

Mark
_______________________________________________

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

References: 
 >Crash while adding to NSTextView (From: Mark Allan <email@hidden>)
 >Re: Crash while adding to NSTextView (From: Kyle Sluder <email@hidden>)

  • Prev by Date: Re: Crash while adding to NSTextView
  • Next by Date: Re: layer contents briefly appearing stretched when resizing
  • Previous by thread: Re: Crash while adding to NSTextView
  • Next by thread: origin: lower left vs lower right
  • Index(es):
    • Date
    • Thread