ios - Change attributes on view controller on alert selection (objective c) -


i'm new objective c , need help. i've 1 view controller should show when default array called factbook. i'd change array alert validation. if user see sport click on sport on alert view , current view controller change theme name sport, background color color scheme i'd sport theme , text sport facts array. every welcome!

- (void)viewdidload {     [super viewdidload];      // init displaying facts     self.factbook = [[factbook alloc] init];     self.colorwheel = [[colorwheel alloc] init];     self.view.backgroundcolor = [self.colorwheel randomcolor];     self.funfactlabel.text = [self.factbook randomfact]; }  - (ibaction)showfunfact:(uibutton *)sender {     self.view.backgroundcolor = [self.colorwheel randomcolor];     funfactlabel.text = [self.factbook randomfact]; }  - (ibaction)changetheme:(uibutton *)sender {     // sport     [changethemenotification addbutton:@"change sport" validationblock:^bool{       bool passedvalidation = true;       return passedvalidation;     } actionblock:^{       // segue sport       self.themename.text = @"sport";       self.sportfactbook = [[sportfactbook alloc] init];       self.sportcolorwheel = [[sportcolorwheel alloc] init];  // not working  //      self.funfactlabel = [self.sportfactbook randomsportfact];          self.view.backgroundcolor = [self.sportcolorwheel randomcolor];     }];                 //... } 

assuming comment

  // not working    //      self.funfactlabel = [self.sportfactbook randomsportfact]; 

is part want fix. if updating label, change text

 self.funfactlabel.text = [self.sportfactbook randomsportfacttext]; 

randomsportfacttext should return nsstring*.

if set output new label object, doesn't update view -- disassociates outlet label in view.

if want change backgroundcolor, can too:

 self.funfactlabel.backgroundcolor = [uicolor redcolor]; 

Comments

Popular posts from this blog

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

linux - disk space limitation when creating war file -