Hi all,
I have a rare issue that happens when I use the watch (OS1) and my iOS app.
Scenario:
- iOS app is in background for a long time. Didn't went through willTerminate according to logs.
- Watch is connecting to the iOS app when watch app is open using handleWatchKitExtensionRequest in order to receive a value stored in appDelegate.
- In iOS app I begin a background task with beginBackgroundTaskWithName inside the handleWatch method so it will let me do a small job in the BG.
- iOS app is calling to an ivar dictionary which is stored in appDelegate and was full with values before app went to BG (couple of hours before).
- Somehow this ivar became nil (nothing in my code caused it according to my logs. Even added an observeValueForKeyPath to grab any change but didn't hit the observer).
- Couple of millis after that the iOS app restarted itself (went into didFinishLaunching).
I'm trying to figure out what just happened and can't find any explanation. How come the ivar becomes nil and how come the iOS app just restarts itself?
HELP.