Re: How to set default value for NSTextField from program before window is displayed?
Re: How to set default value for NSTextField from program before window is displayed?
- Subject: Re: How to set default value for NSTextField from program before window is displayed?
- From: Jonathan Hess <email@hidden>
- Date: Fri, 21 Mar 2008 17:58:55 -0700
Hey Samvel -
Your IBOutlets won't be connected until after init. You should
probably move your code to awakeFromNib.
Gotta run -
Jon Hess
On Mar 21, 2008, at 5:09 PM, Samvel Khalatian wrote:
Hi,
I am quite new in Cocoa programming and didn't understand yet how to
set initial value for some NSTextField from program?
Imagine I have a collection (Array of data, say, mates names). Want
to see the first name from array in window once program starts up.
So, I have a controller. Controller is instantiated in projects NIB.
Field (NSTextField), call it 'mate name', is connected to Controller
via IBOutlet. Unfortunately setting any value in given text field
from Controller init method does not produce any meaningful effect
because it is executed before main window actually displayed
resulting in empty field shown upon window appearance.
So, how to resolve this issue and thus set some text in NSTextField
so that once Window is opened this value to be automatically shown?
Thanks.
_______________________________________________
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
_______________________________________________
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