In a word game for iPhone:

I\'m trying to use the following code in my custom view Tile.
NSDictionary objects can't be created at compile time. However, if you need a static object, you can create one. You can, for example, use the initialize method, like this:
static NSDictionary* letterValues;
+ (void)initialize
{
if (self == [MyClass class]) {
letterValues = @{
@"A": @1,
@"B": @4,
@"C": @4,
@"X": @8,
@"Y": @3,
@"Z": @10,
};
}
}
The if statement is there to prevent multiple calls of your code in MyClass subclasses.