• 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: Newbye with .. a button :-))
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Newbye with .. a button :-))


  • Subject: Re: Newbye with .. a button :-))
  • From: Charles Jolley <email@hidden>
  • Date: Tue, 31 Jul 2001 09:44:44 -0500

Hi Riccardo:
The information you are looking for is not in the NSTextField documentation, but in the NSControl documentation, NSTextField's superclass. You can find it in the Cocoa Reference docs others have sent links to. Welcome to the joys of subclasses!

FYI, the method you are looking for is stringValue. You can retrieve the value of any control as a string by using this method:

[myControl stringValue]

Likewise, you can set the value of any control as a string by using the method:

[myControl setStringValue: @"The String"] ;

This is a great aspect about Cocoa because it allows you to replace controls with other controls without changing any code. I recently changed a user interface widget on the program I am working on from a stepper to a slider without changing any code...it was very exciting! :-)

Cheers,
-Charles

On Tuesday, July 31, 2001, at 07:28 AM, Riccardo Santato wrote:

Hi everybody,

I'm new to COCOA, NexTStep and other things but I wanted started programming with OS X using Cocoa and Objective - C.
The question is I wanted to create a very simple program : a cocoa app in which by pressing a button you will see a string appearing on a textfield... quite simple, isn't it ? :-))

I can't manage to get things work; here's the passages I've done...

1) Create the interface
2) create a subclass of NSObject with an outlet and an action in it
3) Istantiate the subclass
4) Made the connections in a correct way ( I used printf to check it)

Now in the developer docs I can't find the way to make my cocoa app modify the inside of the textfield. What method have I to give it ?
Where can I find it on the documentation on my hard disk (tidy X and developer tools installation) ?

Thank you for your help .

--
Riccardo Santato
www.riccardosantato.com
_______________________________________________
cocoa-dev mailing list
email@hidden
http://www.lists.apple.com/mailman/listinfo/cocoa-dev


  • Follow-Ups:
    • Re: Newbye with .. a button :-))
      • From: Riccardo Santato <email@hidden>
References: 
 >Newbye with .. a button :-)) (From: Riccardo Santato <email@hidden>)

  • Prev by Date: Re: Book recommendations for newbies
  • Next by Date: Re: Run Loops
  • Previous by thread: Re: Newbye with .. a button :-))
  • Next by thread: Re: Newbye with .. a button :-))
  • Index(es):
    • Date
    • Thread