Theocacao
Leopard
Design Element
Comment on "Using Delayed Messages in Cocoa"
by Nic Heath — Sep 07
I ran into this problem tonight and here is something interesting.
I am setting up links in Interface Builder so my IBOutlet *mySearchBar is connected to the search bar my NIB.

My code looks as such
if (mySearchBar == NULL) NSLog(@"empty pointer");

prints out this in the console when I run it on my iPhone.
2008-09-07 01:08:44.540 HamInfo[15538:20b] empty pointer

When I use the method described in the post this fixes the problem. I'm confused as to why everyone is saying that the NIB is fully initialized and connected when the reference in my controller class is not connected by the time the program executes awakeFromNib.
Back to "Using Delayed Messages in Cocoa"
Design Element

Copyright © Scott Stevenson 2004-2015