RE: Non functioning IBOutlet
RE: Non functioning IBOutlet
- Subject: RE: Non functioning IBOutlet
- From: "Jonathan E. Jackel" <email@hidden>
- Date: Mon, 10 Mar 2003 12:29:03 -0500
I've generally been able to solve problems with uncooperative outlets by
doing the following:
1. Statically type the outlet, e.g., IBOutlet NSTextField GroomingAmount
(BTW, the convention is to lowercase the g, but what they heck). That way
IB will prevent you from connecting the outlet to any other type of object.
With complex views (e.g., tableviews) this is really helpful.
2. Make sure to save the header file. This is a step I sometimes forget.
IB apparently looks at the disk version of the header, so new outlets are
ignored in IB unless you save first.
3. Drag the header file's icon from its title bar in PB to the Instances tab
of the nib's window in IB.
4. Hook up the outlet.
5. Save the nib file. By far, this is the step I forget the most. PB
doesn't necessarily remind you or do it for you when you build. If I had to
guess, this is probably what you are forgetting. The symptoms are
consistent with what you are reporting -- outlets that point to nothing.
6. If it still doesn't work, disconnect the outlet, trash the field, drag a
new field from the palette, rehook the outlet, and save the nib.
Jonathan
>
I've got an outlet defined in my controller as:
>
>
IBOutlet id GroomingAmount;
>
>
, along with many other fully working outlets. The controller is
>
instanciated in the NIB file for the project. I've connected everything
>
up in IB (it's a text field), just as normal, and although all the
>
other outlets work just fine, this one doesn't. It reads as NULL.
>
>
I've had this happen earlier in the project when I tried to set a
>
button as and outlet, but turning it into an NSMatrix solved that, even
>
though it should never have been broken in the first place.
>
>
I've tried cleaning the project, re-making the links in IB, removing
>
the controller, re-loading it and re-making the links.
>
>
Any other ideas on how to fix this??
>
>
Graeme
>
_______________________________________________
>
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.