Re: Non functioning IBOutlet
Re: Non functioning IBOutlet
- Subject: Re: Non functioning IBOutlet
- From: Fritz Anderson <email@hidden>
- Date: Thu, 13 Mar 2003 14:17:54 -0600
By any chance, do you have a controller method named setGroomingAmount?
In the process of connecting IBOutlets, the NIB loader looks for setter
methods with names of the form "set{outletName}". If such a method
exists, the loader assumes the method sets the outlet variable, and
calls it.
If, however, your setGroomingAmount sets some domain-specific state,
and not GroomingAmount, then GroomingAmount will emerge from the NIB
loader uninitialized. (And, whatever setGroomingAmount sets will get
set to some bizarre scalarization of the NSTextField's pointer.)
-- F
On Monday, March 10, 2003, at 01:29 PM, email@hidden wrote:
Thanks for the suggestions.
I've tried all the below - it looks to me as something is broken with
the NIB or the project some how.
I've examined the NIB file in BBEdit and all seems ok.
Is there a way to debug the NIB file to see what's happening when the
outlets get all linked in??
The other outlets in the project work just fine.... I've done this
many times before and I've never had a problem making outlets work. Is
this some sort of bug I've come across?
Graeme
On Monday, March 10, 2003, at 02:11 pm,
email@hidden wrote:
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
--
Fritz Anderson - Consulting Programmer - Chicago, IL
Mail: <email@hidden>
Risumi: <
http://resume.manoverboard.org>
_______________________________________________
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.