• 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 -becomeFirstResponder
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSTextView and -becomeFirstResponder


  • Subject: NSTextView and -becomeFirstResponder
  • From: Jim McGowan <email@hidden>
  • Date: Mon, 20 Feb 2012 13:29:30 +0800

Hi,

I have an NSTextView subclass and I need it to inform another object of when it becomes first responder - along the lines of overriding -becomeFirstResponder something along the lines of this:

- (BOOL)becomeFirstResponder {
	[someOtherObject textViewBecameFirstResponer:self];
	return [super becomeFirstResponder];
}

However, I'm a bit confused by the docs.  -becomeFirstResponder is marked as being deprecated for NSTextView, but not deprecated in its superclass NSResponder.  The NSTextView docs for this method reads:

"Informs the receiver that it’s becoming the first responder. (Available in Mac OS X v10.0 through Mac OS X v10.4. Use the NSWindowmethod makeFirstResponder: to make a text view the first responder.)"

Whereas in NSResponder simply reads:

"Notifies the receiver that it’s about to become first responder in its NSWindow."

Overriding this method in my text view subclass works just fine, but I'm concerned that this is fragile.  Any suggestions on overriding a method that is deprecated in a parent class but not in a grandparent class?  Or suggestions for an alternative?

Thanks,
Jim.
_______________________________________________

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: NSTextView and -becomeFirstResponder
      • From: Conrad Shultz <email@hidden>
    • Re: NSTextView and -becomeFirstResponder
      • From: Kyle Sluder <email@hidden>
  • Prev by Date: NSStepper - useless?
  • Next by Date: Re: __block __weak - am I doing this right?
  • Previous by thread: Re: NSStepper - useless?
  • Next by thread: Re: NSTextView and -becomeFirstResponder
  • Index(es):
    • Date
    • Thread