I am trying to finish this method for quite some time ,but I am a bit stuck. I am trying to make it where the slog will go 1,2,3,4,beep instead of what it is doing currently 1,2,3,4,5,beep,6. I was wondering how to perform such a method.There is more to my code ,but I will put the essential code up.(p.s.) I did a lot more to try to solve this, so I post basic code for everyone to understand.
-(IBAction)setmethod:(id)sender{
for (int k=1;i<=20;k++){
NSLog( @"%d",k);
if(k % 5 == 0) { NSLog( @"beep");
You can simply move 1st NSLog to the else case: