سؤال

Say I'm making a game using the new storyboard feature in Xcode and I have the main menu navigation controller as my initial view controller. Then when the user starts a new game I then load the gameplay view controller using a modal segue, for example. The navigation controller would still be my root view controller while I'm doing all of my rendering etc., right?

My question is how much overhead does this take up? Does it hurt the performance of my game to just have the nav controller hanging around back there? If you've built an iPhone game, how have you handled the menus?

I am also thinking about this because I'm building in a little treasure hunt easter egg that uses the GPS. Once you get into that part of the app, you'll never go back to the game. At that point since the GPS is in use, battery life is an issue. Does it hurt anything to have the game stuff sitting back there even though it will never be used again in the current life of the app?

I've tried building a couple custom segues that actually change the root view controller to get around this, but writing custom segues is actually pretty nasty if you try to do anything that isn't simple. I'm also not sure if that's the right move.

Sorry if these are silly questions, I'm pretty new to iOS.

هل كانت مفيدة؟

المحلول

Here are answers on some of your questions :

  1. The navigation controller would still be my root view controller while I'm doing all of my rendering etc., right? YES

  2. Does it hurt the performance of my game to just have the nav controller hanging around back there? a little as memory is used but not to much according to me.

IMPORTANT NOTE : if you are using story boards your application won't work before iOS5.0 which means you will lose a lot of potential users.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top