Home › Forums › OpenEars › Multiple pocketsphinxController Controller › Reply To: Multiple pocketsphinxController Controller
You should only have a single PocketsphinxController in an app. I recommend putting it in a root view controller and communicating with it with delegate methods or notifications. Others have also had success putting it in a singleton which any view controller can communicate with; I don’t support that architecture (i.e. if it gives you issues, I can’t help with them) but there are certainly strong arguments for it. If you want to instantiate a PocketsphinxController in a view and then exit the view in favor of a different view with a different PocketsphinxController, it’s a requirement to first call stopListening before exiting the view so that all the OpenEars multithreading can clean up and ARC can do its job releasing the first PocketsphinxController; otherwise you will have two PocketsphinxControllers which will not work.