我有一个数组。从该数组中获取图像我想将数组索引传输到下一个方法我该怎么做。
我的代码:-
FrontsCards =[[NSMutableArray alloc]initWithCapacity:13];
[FrontsCards insertObject:@"cloub1.png" atIndex:0];
[FrontsCards insertObject:@"cloub2.png" atIndex:1];
[FrontsCards insertObject:@"cloub3.png" atIndex:2];
[FrontsCards insertObject:@"cloub4.png" atIndex:3];
[FrontsCards insertObject:@"cloub5.png" atIndex:4];
[FrontsCards insertObject:@"cloub6.png" atIndex:5];
[FrontsCards insertObject:@"cloub7.png" atIndex:6];
[FrontsCards insertObject:@"cloub8.png" atIndex:7];
[FrontsCards insertObject:@"cloub9.png" atIndex:8];
[FrontsCards insertObject:@"cloub10.png" atIndex:9];
[FrontsCards insertObject:@"cloub11.png" atIndex:10];
[FrontsCards insertObject:@"cloub12.png" atIndex:11];
[FrontsCards insertObject:@"cloub13.png" atIndex:12];
随机获取所有图像并垂直存储图像视图滚动
randIdx=arc4random()%[FrontsCards count];
NSString *imageName=[FrontsCards objectAtIndex:randIdx];
[ImgView setImage:[UIImage imageNamed:imageName]];
如果用户双击 cloub12.png 图像,我想生成 11 索引值并将其传输到下一个视图控制器。如果用户点击 cloub4 索引生成 3
我怎么能这样做提前谢谢。