• 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: NEWBIE/TRTFM: identify objects created in IB
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NEWBIE/TRTFM: identify objects created in IB


  • Subject: Re: NEWBIE/TRTFM: identify objects created in IB
  • From: Stéphane Sudre <email@hidden>
  • Date: Thu, 8 Aug 2002 19:52:59 +0200

On Thursday, August 8, 2002, at 07:19 PM, ber wrote:

I have a pane created in IB with 8 textfields. 4 are used as labels and 4 are for text entry for a form.
There is also an Okay button. When a user clicks the Okay button I'd like to read the strings from
the text entry textfields. I don't know how to go about that as I don't know how to identify the textfields.
I suppose I could traverse all the objects in the pane and divine which ones are relevant based on their
location. What am I overlooking?

If I create the textfields programatically then it's straightforward.

On a related note I have not figured out how to add rows to an NSForm pulled from the palette in IB (2.3 (v283)).
The operations I use for matrixes and popups don't seem to apply to forms.

You have 2 solutions:

- The first one: Use a NSForm instead of NSTextField, you will be able to get your text data via

[[myForm cellAtIndex:myIndex] stringValue]

If you can add checkboxes a group of checkboxes, you should be able to add rows to a NSForm.

Push the Alt key, and click on the (middle-bottom) resize-point and drag it to the bottom. The new rows will appear as soon as there is enough new vertical space.

- The other one: Create in your controller as many outlets as you have editable text fields and link them to your editable textfield. Then use the outlet name and the [myTextField stringValue] method.

Hope it helps.
_______________________________________________
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.

References: 
 >NEWBIE/TRTFM: identify objects created in IB (From: ber <email@hidden>)

  • Prev by Date: Quick question
  • Next by Date: NSImageView question
  • Previous by thread: Re: NEWBIE/TRTFM: identify objects created in IB
  • Next by thread: Re: NEWBIE/TRTFM: identify objects created in IB
  • Index(es):
    • Date
    • Thread