-1

什么语法可以使这项工作?

    NSString *curstring = [cur description];
    UIImage *weatherimage = [UIImage imageNamed: @"@%.png", curstring];
    [weather setImage:weatherimage];

谢谢

4

1 回答 1

4

你正在寻找NSString 的stringWithFormat:

UIImage *weatherimage = [UIImage imageNamed:[NSString stringWithFormat:@"@%.png", curstring]];
于 2013-01-31T23:41:56.503 回答