I am building an app where I need to change some helpful information based on what stage the user is at:
I used strings labeled Stage1 … Stage7 in the dictionary and I want to display the helpful info from each Stage wen the user moves the slider.
NSDictionary *foodInfo = [foodArray objectAtIndex:row];
NSInteger numberLookup = lroundf([stageSlider value]);
NSString* stageText = @"Stage";
stageText = [stageText stringByAppendingFormat:@"%i", numberLookup];
NSNumber *helps = [foodInfo objectForKey:@"Stage1"]; // Need stageText string instead "Stage1" shown?
notesLabel.text = helps;
Currently I display the “Stage1” text no matter where the slider is positioned and I have verified that “stageText” is incrementing/decrementing just fine.
How do I put the stageText string in instead of the text string shown?
Thanks for the help.
padapa
Like that ?
NSNumber *helps = [foodInfo objectForKey:[NSString stringWithFormat:@"stage%d",numberLookup]];