我正在尝试对数组元素执行操作,但我真的不明白为什么我的代码不起作用:
这是我的.h:
@interface ViewController : UIViewController
{
NSArray *tableauScore;
UILabel * modificationScore;
}
@property (weak, nonatomic) IBOutlet UILabel *nom1;
@property (weak, nonatomic) IBOutlet UILabel *nom2;
@property (weak, nonatomic) IBOutlet UILabel *nom3;
@property (weak, nonatomic) IBOutlet UILabel *nom4;
@property (weak, nonatomic) IBOutlet UILabel *bsc1;
@property (weak, nonatomic) IBOutlet UILabel *bsc2;
@property (weak, nonatomic) IBOutlet UILabel *bsc3;
@property (weak, nonatomic) IBOutlet UILabel *bsc4;
@end
我的.m:
tableauScore = [NSArray arrayWithObjects:nom4, nom3, nom2, nom1, bsc1, bsc2, bsc3, bsc4, nil];
for(int i = 0; i < 8; i++)
{
modificationScore = [tableauScore objectAtIndex:i];
modificationScore.hidden = NO;
modificationScore.center = CGPointMake(modificationScore.center.x, modificationScore.center.y -40);
}
问题是我在“modificationScore = [tableauScore objectAtIndex:i];”处有一个线程点 线,我不知道为什么。我看到了很多主题,但没有人可以帮助我。你们中有人有想法吗?
谢谢你!