I have a storyboard application. When the first view is loaded on startup, I have this code to instantiate my main background thread and it all works fine.
public override void AwakeFromNib()
{
base.AwakeFromNib();
// Perform one-time initialization in this function
// Create and start the main worker thread
MainBackgroundThread = new Thread(new ThreadStart(MainLoop.RunWorker));
MainBackgroundThread.Start();
}
However, when the user goes to a different view and then goes back to the first view via a segue, AwakeFromNib() is called again. I thought it was only supposed to be called once... Where do I start my main background thread so it only ever gets started once?