title: Best design for assigning CoreLocation & CoreMotion updates through multithreading?
body: <p>I have a <code>Game</code> class that has a <code>-(void) play</code> method which will be executed when the user clicks on the Play button on the device.</p>
  
  <p>Inside the <code>-(void) play</code> method I have a while loop that will be executed repeatedly until the user clicks on the Quit button. This while loop is basically the core of my code, where all necessary methods are being called, things happen, objects interact etc.</p>
  
  <p>I also have a User class (amongst other classes..) and I create a <code>User* player</code> instance in the <code>-(void) play</code> method of my Game class to store some values and have those interact with other things along the duration of the game..</p>
  
  <p>Now I need to know (at any moment during the game..) the device's deviation from the magnetic North &amp; the acceleration the user is exercising on the device </p>
  
  <p>I've written the code and everything is <strong>working fine</strong>. However, being new to programming I have a few questions concerning the overall <strong>design</strong> of my code, which I think is <strong>a mess especially when it comes to using the CoreLocation &amp; CoreMotion frameworks</strong>..</p>
  
  <p>The <code>-(void) play</code> method of the Game class (which is basically my "main" method) is executed on a separate thread as in <code>[game performSelectorInBackground:@selector(play) withObject:nil];</code> Is this the right way to do it?</p>
  
  <p>However, I initialise CoreMotion Acceleration updates from inside the <code>-(void) play</code> method as in <code>[motionManager startDeviceMotionUpdatesToQueue:[NSOperationQueue mainQueue]withHandler:^(CMDeviceMotion *motion, NSError *error){...}</code> which means that updates will be stored in the main Queue whereas the method initializing these updates is executed from inside a method(<code>-(void) play</code>) that runs on a separate thread. Does that make sense?</p>
  
  <p>I also initialise CoreLocation updates when I initialize an instance of my Game class. Even more weird?</p>
  
  <p>My point is this. Given that I'll be measuring the acceleration the user is exercising on the device and the orientation he/she is giving to the device (degrees) I want to encapsulate all that in my User class and have methods like <code>[player getMyDegrees];</code> and <code>[player getMyAcceleration];</code> Isn't this the correct way design-wise? Where exactly should I initialize those updates? From inside which specific class-method? Should everything be running on the same main thread or the same separate thread or on different separate threads? I'm confused.. </p>