This happens to me as well.
Only in my case it sometimes happens when my app receives local notification.
Kof
2010-07-31 05:07:15
This happens to me as well.
Only in my case it sometimes happens when my app receives local notification.
Keep a counter for switches and ignore switches that happen in the wrong order. Something like this:
-(void) handleSwitchToBackground {
if ( myState == 0 ) { /* do background stuff */ }
myState += 1;
}
-(void) handleSwitchToForeground {
myState -= 1;
if ( myState == 0 ) { /* do foreground stuff */ }
}
If foreground happens before background, neither method does anything.