• 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: NSTextView - firstResponder notification?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSTextView - firstResponder notification?


  • Subject: Re: NSTextView - firstResponder notification?
  • From: Mike Abdullah <email@hidden>
  • Date: Sat, 18 Mar 2006 00:44:01 +0000

Out of interest (seeing as it wasn't me who asked the question), why do you use performSelector:withObject:afterDelay in this case?

Mike.

On 18 Mar 2006, at 00:20, Jordan Krushen wrote:

On 3/17/06, Arne Bech <email@hidden> wrote:
I have a NSTextView in a window (along with some other stuff). The
NSTextView is by default showing the word "notes". Is there any way
to make that text selected whenever the user cliks or tabs into the
textView? and possible so only when it has the word "notes"?

You could subclass NSTextView in IB, create the files for it, set the view's custom class to your new subclass, and stick this in the implementation (not thoroughly tested):

- (BOOL)becomeFirstResponder
{
NSString *viewText = [[self textStorage] string];

if ([viewText isEqualToString:@"notes"]) {
NSLog(@"text is 'notes', selecting");
[self performSelector:@selector(selectAll:) withObject:self afterDelay:0];
}

return YES;
}


HTH,

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


This email sent to email@hidden

_______________________________________________ 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 - firstResponder notification?
      • From: "Jordan Krushen" <email@hidden>
References: 
 >NSTextView - firstResponder notification? (From: Arne Bech <email@hidden>)
 >Re: NSTextView - firstResponder notification? (From: "Jordan Krushen" <email@hidden>)

  • Prev by Date: Re: NSTextView - firstResponder notification?
  • Next by Date: Re: NSTextView - firstResponder notification?
  • Previous by thread: Re: NSTextView - firstResponder notification?
  • Next by thread: Re: NSTextView - firstResponder notification?
  • Index(es):
    • Date
    • Thread