Re: NEWBIE/TRTFM: identify objects created in IB
Re: NEWBIE/TRTFM: identify objects created in IB
- Subject: Re: NEWBIE/TRTFM: identify objects created in IB
- From: John Pannell <email@hidden>
- Date: Thu, 8 Aug 2002 12:08:55 -0600
Hi there-
Here's some hints for you...
In IB:
- in the classes tab, select the class that you are using as a
controller and add 4 outlets to it. Each outlet should be named for
each field (i.e. nameField, addressField, etc.)
- in the instances tab, control drag from the controller object to a
text field. This creates a connection between the two. An inspector
window will pop up. Double click on the name of the outlet that is
appropriate to the field you just dragged to. Do this for the other
fields.
If you have not already used IB to create files (Classes > Create
Files...) do so now. If you already have files, you will need to add
the new outlets to the header file of your controller object. Add lines
that look like the following:
IBOutlet NSTextField *nameField;
IBOutlet NSTextField *addressField;
etc.
In PB:
- you can now refer to the text field objects in your interface by
name. To get the string value of the contents, you would simply ask the
object for it.
[nameField stringValue];
This is a quick overview that assumes you understand what a controller
is, outlets/actions, and IB and PB - let me know you need more help!
John P.
On Thursday, August 8, 2002, at 11:19 AM, 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.
Thanks,
brian
_______________________________________________
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.
_______________________________________________
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.