String watchkit-如何在图像中使用我的数字

String watchkit-如何在图像中使用我的数字,string,image,watchkit,String,Image,Watchkit,我有以下代码: for(int i = 0; i < 4; i++){ NSMutableString *Row = [NSMutableString new]; for(int j = 0; j < 4; j++){ [Row appendString:[NSString stringWithFormat:@"%d", numbers[j][i]]]; } NSLog(@"%@\n", Row); } for(int i=0;i

我有以下代码:

for(int i = 0; i < 4; i++){
    NSMutableString *Row = [NSMutableString new];
    for(int j = 0; j < 4; j++){
        [Row appendString:[NSString stringWithFormat:@"%d", numbers[j][i]]];
    }
    NSLog(@"%@\n", Row);
}
for(int i=0;i<4;i++){
NSMutableString*行=[NSMutableString new];
对于(int j=0;j<4;j++){
[Row appendString:[NSString stringWithFormat:@“%d”,数字[j][i]];
}
NSLog(@“%@\n”,第行);
}
通过此操作,我得到以下输出:

6473 7354 9835 6475

我的WKInterfaceController上有16个分组图像,现在我想为每个数字显示一个图像。例如,a 4=image4.png,8=image8.png

第一行是:image6、Image4、image7和image3,依此类推


如何到达那里?

您需要在imageView的实例上设置图像(
WKInterfaceImage

您的上述代码只是根据您的方法给出imageName。如果故事板中有多个
WKInterfaceImage
对象,则需要为每个对象制作输出,然后相应地设置图像。由于
WatchKit
不支持收集插座,因此您需要为每个
WKInterfaceObject
设置插座。您可以将“从检查器”中的图像设置为“如果某个特定对象的图像应始终相同”

yourimageView.setImage(UIImage(named: "image name string"));