I have a UIView
with a UITableView
and a UIImageView
in it. The UITableView
takes up the top half of the UIView
Create a flag (BOOL) to control the updating of the image.
Clear it when you want the routine that updates the image to ignore the fact that it was called by the timer event firing. When you want the image updates to resume, just set the flag. Maybe something like this:
-(void)ImageUpdater:(NSTimer *)theTimer
{
if(image_updates_enabled)
{
// Code to update image
}
}
Since you are firing a method only every three seconds it isn't a big deal to just let the timer run.
The other thing you can to is to setup the timer so that it does not repeat. With that in place the decision to re-enable the timer could be made somewhere else in your code rather than automatically. You could even do it within the callback function and still use the "image_updates_enabled" flag if you wish.