ios - reload REFrostedViewController -
i have implemented refrostedviewcontroller , amazing. menu implemented correct view controllers (when correct row tapped, goes appropriate view controller). however, unable reload menu new view controllers , labels depending on flow of application.
for example, assume menu has row called "sign in" take user "signinviewcontroller". let's assume signed in successfully. wish reload menu row says "sign out" , contains "signoutviewcontroller".
can tell me how can done? of now, menu rows , view controllers created @ initialization within demomenuviewcontroller.m (in uitableview delegate methods).
you - simplicity, code has single section in menu.
@property (strong,nonatomic) nsmutable array *menutitles; -(void) viewdidload { [super viewdidload]; self.menutitles=[[nsmutablearray alloc]init]; [self.menutitles addobject:@"login"]; // can change later using [self.menutitles setobject:@"logout" atindexedsubscript:0]; [self.menutitles addobject:@"item 2"]; ... } - (nsinteger)tableview:(uitableview *)tableview numberofrowsinsection:(nsinteger)sectionindex { return [self.menutitles count]; } - (uitableviewcell *)tableview:(uitableview *)tableview cellforrowatindexpath:(nsindexpath *)indexpath { static nsstring *cellidentifier = @"cell"; uitableviewcell *cell = [tableview dequeuereusablecellwithidentifier:cellidentifier]; if (cell == nil) { cell = [[uitableviewcell alloc] initwithstyle:uitableviewcellstyledefault reuseidentifier:cellidentifier]; } cell.textlabel.text = self.menutitles[indexpath.row]; return cell; }
Comments
Post a Comment