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

Talking to FirstResponder


  • Subject: Talking to FirstResponder
  • From: Colin Jackson <email@hidden>
  • Date: Sat, 11 Jan 2003 23:47:49 +0000

Hi,
I'm in the middle of writing my first Cocoa app. My App is probably one of the most complex things I have ever programmed but I am slowly learning that Cocoa usually has a solution to all my problems - my app is based around a text editor which could probably be made in about 30 seconds from start to finish if you rehearsed it a few times.

Anyway, so here is the problem. I need to perform actions on whatever the FirstResponder is every-so-often. It's easy enough to attach a button to a FirstResponder in IB but how can I call the same set of actions from within the program?

I tried this:
[[[NSApp keyWindow] firstResponder] print];

But it doesn't work:
warning: 'NSResponder' does not respond to print
at compile time
and
*** -[NSWindow print]: selector not recognized
at runtime

By the way, the actions I actually want to perform are all the ones to do with spell-checking.

Help would be much appreciated.

Colin
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: Talking to FirstResponder
      • From: "John C. Randolph" <email@hidden>
    • Re: Talking to FirstResponder
      • From: Sherm Pendley <email@hidden>
  • Prev by Date: Re: Custom cells in tableview
  • Next by Date: Syntax Coloring and NSTextStorage
  • Previous by thread: Re: Fun with componentsSeparatedByString!
  • Next by thread: Re: Talking to FirstResponder
  • Index(es):
    • Date
    • Thread