• 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
NSTextView and -smartInsertForString:replacingRange:beforeString:afterString:
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSTextView and -smartInsertForString:replacingRange:beforeString:afterString:


  • Subject: NSTextView and -smartInsertForString:replacingRange:beforeString:afterString:
  • From: Sean Todd <email@hidden>
  • Date: Thu, 6 Oct 2005 13:27:36 -0500

While implementing drag-n-drop text fields I noticed that NSTextView's - smartInsertForString:replacingRange:beforeString:afterString: does not follow Apple's HIG for intelligent cut and paste rules.

The HIG for drop feedback of text  states:

"Drag-and-drop operations involving text should support intelligent cut-and-paste rules, as explained in "Intelligent Cut and Paste."

The HIG for intelligent cut and paste states:

"When the user chooses Paste, if the character to the left or right of the current selection is part of a word (but not inside a word), insert a space before pasting."


If you use - smartInsertForString:replacingRange:beforeString:afterString: to drop (or paste) the text, it results in spaces inserted before and after the dropped text even if the insertion point was in the middle of a word.


You can see this sort of behavior in action with XCode and the search field of a project window. Just type some word in the search field, then drag some other text and drop it in the middle of the word in the search field.

So, should I follow the HIG or use - smartInsertForString:replacingRange:beforeString:afterString:? Is this a case of the guidelines not being kept up-to-date or of Cocoa not following the guidelines?

Thanks for any advice.

Sean

_______________________________________________
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


  • Follow-Ups:
    • Re: NSTextView and -smartInsertForString:replacingRange:beforeString:afterString:
      • From: "Timothy J. Wood" <email@hidden>
  • Prev by Date: Re: only defined for abstract class
  • Next by Date: Re: NSTextView and -smartInsertForString:replacingRange:beforeString:afterString:
  • Previous by thread: Re: Printing multiple pages from drawRect:
  • Next by thread: Re: NSTextView and -smartInsertForString:replacingRange:beforeString:afterString:
  • Index(es):
    • Date
    • Thread