iphone - setting ivar by super -
my interface file:
@interface secondviewcontroller : uiviewcontroller <uitableviewdelegate, uitableviewdatasource> { id delegate; iboutlet uitextfield *textfield; nsarray *list; nsstring *label1; nsstring *label2; uitableview *tableview; }
and implementation of file inherit secondviewcontroller
- (void)tableview:(uitableview *)tableview didselectrowatindexpath:(nsindexpath *)indexpath { [super setlabel1:@"something"]; [self.navigationcontroller popviewcontrolleranimated:yes]; }
but can see in debugger label1 still nil. knows, why?
edit
so didn't enough enunciate. yes, when set ivar in inherit class, nslog shows correctly set, when return superclass ivar in nslog shows nil
it means have not allocated label , set frame it.
edit
sorry missed that, have created test app, it's working fine. can download code here ignore file names. in hurry.:)
Comments
Post a Comment