this example shows one usage of the static,
when a function is called many times, the static variable is just the same one
- (void)move
{
static BOOL bRight = YES;
CGRect tmp = m_btn.frame;
if (bRight)
{
tmp.origin.x += detaX;
}
else
{
tmp.origin.x -= detaX;
}
if (tmp.origin.x > 460)
{
bRight = NO;
}
if (tmp.origin.x < 250)
{
bRight = YES;
}
m_btn.frame = tmp;
}