istornz / iPokeGo

A native iOS client to map the Pokemon around you!
https://github.com/RocketMap/RocketMap
MIT License
642 stars 168 forks source link

Background timer keeps running in foreground #294

Closed fjcaetano closed 8 years ago

fjcaetano commented 8 years ago

When the app goes to background a new NSTimer is allocated and the previous is invalidated.

However, when it comes back to foreground, a new NSTimer is allocated but the previous isn't invalidated, resulting in multiple instances of NSTimer looping and fetching data.

Easily solved adding [self.dataFetchTimer invalidate] before allocating a new instance. I'll see if I can work on this.