Re: NIB doesn't link to objects
Re: NIB doesn't link to objects
- Subject: Re: NIB doesn't link to objects
- From: Phillip Hutchings <email@hidden>
- Date: Sun, 14 Nov 2010 21:15:36 +1300
On 14/11/2010, at 11:46 AM, Charlie Dickman wrote:
> I'm sure I'm missing something really simple here...
>
> In my .h file I define some objects in the interface section as
>
> IBOutlet NSButton * tileButton1, *tileButton2...
>
> in the .m file (an implementation of a NSView) I initialize an array...
>
> NSArray *tileButtons = [[NSArray array WithObjects: tileButton1, tileButton2, ..., nil] retain];
>
> and in the NIB the buttons in the view are linked to the corresponding outlets but when the InitWithFrame method is called the pointers all have addresses assigned but the values are all nil.
>
> What am I not doing (properly)?
There are three common causes for this:
- You assigned tileButtons before -awakeFromNib: was called, in which case they'll be nil
- You haven't correctly connected the objects in Interface Builder
- You're initialising the view incorrectly so you're getting an instance of the class without nib loading
Given what you've already posted, and the fact that I've already made my eye bleed by reading your caps-laden email, I'll suggest the second or third. The second is easy to check, so check how you're getting the object created.
There is, of course, the less common fourth option:
- You behaved rudely to people attempting to help you, so the illuminati used their time machine to sabotage your machine to cause this very problem.
--
Phillip Hutchings
email@hidden
--
Phillip Hutchings
email@hidden
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden