I am new to iOS and I need some feedback about how I can display the output on Iphone screen in an infinite loop.
When the button is pressed, the application goes in an endless loop and creates some outputs. I would like to display these outputs on Iphone screen. Although I get those values from printf on debug screen, nothing shows on Iphone screen. If I would try this function without the infinite loop, I would be able to see the output on screen, however the application must run in infinite loop.
Since I am quite new to programming, does the application need to be run in multi-thread mode?
The code is below:
-(IBAction)button:(UIButton *)sender{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
int output = -1;
while (pool) {
//output is received
if((output != -1) ) {
printf("%i \n", output); // the output is seen on debug screen
self.display.text = [NSString stringWithFormat:@"%i",output]; // the outputs is not shown on iphone
//[pool release];
}
}
}