I'm trying to run a loop
in Xcode , however it does not work.
The console is:
Type the loop number:
5
Nothing else happens in the terminal. There is no 0.1,2,3,4,5.
In short, it gets stuck after I type any number, but from what I've seen, it's still running, so I have to stop to run it again.
The debug session:
I put a breakpoint on the variables and gave a stepover
Doesthishavetodowith@autoreleasepool
?Thesamehappenswithmyswitch
.
Mycode
#import<Foundation/Foundation.h>intmain(intargc,constchar*argv[]){@autoreleasepool{inti,usuario;NSLog(@"Digite o numero do loop: ");
scanf("%i", &usuario);
for (i=0; i<=usuario; i++) {
NSLog(@"%i", i);
}
}
return 0;
}
The project was created in Foundation, Command Line Tool.