Ok I got the solution now. As always, it is pretty simple as soon as you know how :-)
As it seems, that I was not very clear on my initial problem description, here the feature description again:
I needed my app to display text from my SQLITE3 database in a UITextView and update that text every 2 seconds with the text from the next record in the DB. So my initial thought was to do it within the Select loop. With the hint of shaggy, that it the view will not be updated, before finishing the loop as it is running in a single thread, I started to look for another solution and came up with the following selector based solution, which works fantastic.
The solution to such a programatic and iterative update of any object in the user interface is a method like this
- (IBAction)displayTextFromArray:(UIButton *)sender{
timer = [NSTimer scheduledTimerWithTimeInterval:(2.0) target:self selector:@selector(displayText) userInfo:nil repeats:YES];
}
This method in my case is invoked when the user touches a UIButton. To make the schedule stop, it is required to send the following message to the timer instance:
[timer invalidate];
Of course I had to change my code a bit to run with the scheduled timer, but from an iteration perspective, the above code is everything you need to trigger and stop a scheduler. Hope that this helps others with a similar issue too.
Cheers, René