• 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
[Q] How can one programatically begin a text editing session in a NSTextField?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Q] How can one programatically begin a text editing session in a NSTextField?


  • Subject: [Q] How can one programatically begin a text editing session in a NSTextField?
  • From: Eric Gorr <email@hidden>
  • Date: Thu, 5 Feb 2009 10:54:06 -0500

The documentation at:

http://developer.apple.com/DOCUMENTATION/Cocoa/Conceptual/TextEditing/Tasks/SetFocus.html#/ /apple_ref/doc/uid/20000933

seems to indicate that one just needs to do:

[theWindow makeFirstResponder: theTextView];
[theTextView setSelectedRange:NSMakeRange(0,0)];

However, upon closer inspection, this seems to only apply to a NSTextView, not a NSTextField.
For example, NSTextField does not respond to the setSelectedRange message.


But, when I call makeFirstResponder on my NSTextField, it does return true, but an edit session is not started - I cannot type anything which changes the text in the field.

Thank you.


_______________________________________________

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: [Q] How can one programatically begin a text editing session in a NSTextField?
      • From: Eric Gorr <email@hidden>
    • Re: [Q] How can one programatically begin a text editing session in a NSTextField?
      • From: Andy Lee <email@hidden>
  • Prev by Date: Re: Memory management question in Objective-C 2.0 @property notation
  • Next by Date: Re: another NSCFDictionary and GC problem?
  • Previous by thread: System Activity shortly after booting
  • Next by thread: Re: [Q] How can one programatically begin a text editing session in a NSTextField?
  • Index(es):
    • Date
    • Thread