static NSDictionary* const letterValues = @{ … } in a method does not compile
In a word game for iPhone : I'm trying to use the following code in my custom view Tile.m : - (void)awakeFromNib { [super awakeFromNib]; static NSDictionary* const letterValues = @{ @"A": @1, @"B": @4, @"C": @4, // ... @"X": @8, @"Y": @3, @"Z": @10, }; NSString* randomLetter = [kLetters substringWithRange:[kLetters rangeOfComposedCharacterSequenceAtIndex:arc4random_uniform(kLetters.length)]]; int letterValue = [letterValues[randomLetter] integerValue]; _smallLetter.text = _bigLetter.text = randomLetter; _smallValue.text = _bigValue.text = [NSString stringWithFormat:@"%d", letterValue]; }