On Wed, Jun 1, 2011 at 9:15 AM, Eric Williams <wile...@gmail.com> wrote:
> Probably fundamental but I haven't got my head straight on this.
>
> Xcode 4.0.2
> OS X 10.6.7
>
> I have an app that is a single window that I load NSView elements over the 
> course of the life of the app.
>
> I want to set the first responder for the window to be a text field in the 
> NSView after the view is loaded, so that a user can immediately start typing 
> into the field.

You actually want to use initialFirstResponder here. You can wire up
the window's initialFirstResponder outlet in IB to your text field,
and it will do the right thing.

In the general case (where you want to set first responder sometime
*after* window loading) use -[NSWindow makeFirstRepsonder:].

http://developer.apple.com/library/mac/#documentation/Cocoa/Reference/ApplicationKit/Classes/NSWindow_Class/Reference/Reference.html

--Kyle Sluder
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to