title: How do I initialize CMMotionManager globaly to be used by different classes?
body: <p>i am trying to initialize the device motion manager in a class that contains all of my global variables to use in different classes. However i cant seem to get this working. </p>
  
  <p>I have this in my global class:</p>
  
  <pre><code>// Motion Manager
  CMMotionManager *motionManager;
  </code></pre>
  
  <p>Then set the property  in a different class header file:</p>
  
  <pre><code>@property (retain) CMMotionManager *motionManager;
  </code></pre>
  
  <p>And on the .m file i synthetize and start the updates:</p>
  
  <pre><code>@synthesize motionManager;
  
  motionManager = [[CMMotionManager alloc] init];
  
  if (motionManager.deviceMotionAvailable) 
      {
          motionManager.deviceMotionUpdateInterval = 1.0/100.0;
          [motionManager startDeviceMotionUpdates];
          NSLog(@"Device Started");
  
      }
  </code></pre>
  
  <p>But when i call this on my third class:</p>
  
  <pre><code>motionManager.deviceMotionAvailable
  </code></pre>
  
  <p>It returns NO.</p>
  
  <p>PD: both classes import the global class, and the third class imports the second one's header.</p>