I'm making an app that when you press a button it give you a random image. When I run it I don't get any error, but when I click on the button the app freeze and on xcode it says "Thread 1: breakpoint 1.1" at the end of this code right here:
-(void)changeLabel{
progressView.progress += 0.15;
if (progressView.progress == 1) {
label.hidden = YES;
progressView.hidden = YES;
[timer invalidate];
imagenesTest.hidden = NO;
int randomNumber = arc4random() % 4;
switch (randomNumber) {
case 0:
imagenesTest.image = [UIImage imageNamed:@"image1.png"];
break;
case 1:
imagenesTest.image = [UIImage imageNamed:@"image2.png"];
break;
case 2:
imagenesTest.image = [UIImage imageNamed:@"image3.png"];
break;
case 3:
imagenesTest.image = [UIImage imageNamed:@"image4.png"];
default:
break;
}
}
}
When I press a button it supposed to active a progress bar and then put the random image. It gives the error before the progress bar starts working. Here is the code I have for the button:
- (IBAction)scan:(id)sender {
label.hidden = NO;
imagenesTest.hidden = YES;
progressView.hidden = NO;
progressView.progress = 0;
timer = [NSTimer scheduledTimerWithTimeInterval:1 target:self selector:@selector(changeLabel) userInfo:nil repeats:YES];
}
When I click on the thread, it highlights me this
0x94feb6: jmp 0x3ef05
; -[UIWindow _setRotatableClient:toOrientation:updateStatusBar:duration:force:isRotating:] + 4724
Am I doing something wrong with the code? Sorry if I didn't explain myself well, I started programming a some months ago
Thank you, Emilio