• 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: How to set default value for NSTextField from program before window is displayed?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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: Samvel Khalatian <email@hidden>
  • Date: Fri, 21 Mar 2008 19:53:51 -0500

I use:

[nameField setStringValue: ...];

in Collector init. Even though window shows up with empty field. I assume it is emptied upon show up or window construction.

How can is be set up to some non-empty string in such a way that window appear with some value?

Thanks.

On Mar 21, 2008, at 7:30 PM, Amr Nashaat wrote:

hi,

values in NSTextField are not set by the convetional way, the are set by using the SetStringValue command. so for example if you have a certain string in variable called temp and you want to display it in a text field the command will be as follows:

[textField setStringValue:temp];

hope this helps you.



On Mar 22, 2008, at 2:09 AM, 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


References: 
 >How to set default value for NSTextField from program before window is displayed? (From: Samvel Khalatian <email@hidden>)
 >Re: How to set default value for NSTextField from program before window is displayed? (From: Amr Nashaat <email@hidden>)

  • Prev by Date: Re: How to set default value for NSTextField from program before window is displayed?
  • Next by Date: Re: Simple Out-of-Box Demo: Private Framework Crashes in 10.3.9
  • Previous by thread: Re: How to set default value for NSTextField from program before window is displayed?
  • Next by thread: Re: How to set default value for NSTextField from program before window is displayed?
  • Index(es):
    • Date
    • Thread