iPhone - Cannont access to an IBOutlet (nil valued)

Posted by Oliver on Stack Overflow See other posts from Stack Overflow or by Oliver
Published on 2011-01-15T12:45:00Z Indexed on 2011/01/15 12:53 UTC
Read the original article Hit count: 227

Hello,

I have a problem acessing a IBOutlet.

I have a NIB inside which there is a tableview, a toolbar and an UILabel (encasulated into a view). The controller (that is the file's owner) is defined as :

@interface ChoixPeriodeController : UIViewController <UITableViewDelegate> {    
    IBOutlet UILabel* __periodeInitialeLabel;
}

@property(nonatomic, retain) UILabel* periodeInitialeLabel;

- (void) setSelectedPeriode:(Tache_TypePeriode)typePeriode;

In the .m file, this function is called by the parent window to init the Label :

- (void) setSelectedPeriode:(Tache_TypePeriode)typePeriode {
    NSMutableString* tmpString = [NSMutableString string];

    [tmpString appendFormat:bla bla bla;....];

    self.periodeInitialeLabel.text = tmpString;
}

Into this function, I can see that self.periodeInitialeLabel is at nil. I can't see why ? Everything is connected into IB... Do you see what can be the problem ?

© Stack Overflow or respective owner

Related posts about iphone

Related posts about interface-builder