Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8282647
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T10:26:39+00:00 2026-06-08T10:26:39+00:00

I have read Apple’s documentation on CMMotion and everything that needs to be done

  • 0

I have read Apple’s documentation on CMMotion and everything that needs to be done in order to NSLog accelerometer data appears to be done in my app. However, when I run my app and flip the screen there is no data returned from the Accelerometer. I have no runtime errors. Here is my code:

- (void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:animated];
    ad = [[CMMotionManager alloc] init];
    //[ad startDeviceMotionUpdates];
    [ad startAccelerometerUpdates];

    //Returns Null
    NSLog(@"Accelerometer Data %@", ad.accelerometerData);

    BOOL accelerometerAvailable = ad.isAccelerometerAvailable?YES:NO;

    // Returns false, else statement is logged
    if(accelerometerAvailable) {
    NSLog(@"I guess it is...");
    } else {
    NSLog(@"I guess it is not...");
      }

    [ad startAccelerometerUpdatesToQueue:[NSOperationQueue currentQueue]     withHandler:^(CMAccelerometerData *accelerometerData, NSError *error) {
    NSLog(@"Your accelerometer data is: %@", accelerometerData.acceleration);
}];

 }

I tried adding this code to another app of mine that returns data on a time interval to make sure that the reason I was not getting data was because viewDidLoad is only called once. I still got nothing.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T10:26:40+00:00Added an answer on June 8, 2026 at 10:26 am

    My mistake here. This issue stems from me using the iOS simulator to run my application. Apparently, the accelerometer does not work in it. I assumed that because shake, and rotate events were allowed that they were for the accelerometer. However, they are just for the repositioning of the screen, which is independent of the accelerometer. It would help if Apple included this in its documentation.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have read in the Apple Documentation that we can use optional parameters in
I have read in the Apple Documentation that StoreKit will not restore subscriptions on
I have read the Apple documentation, and many postings on the subject on SO,
I have read from some article that say's Apple doesn't approve the application which
According to Apple documentation and other documentation I have read about on disk encryption
I have read the Apple documentation regarding Mobile Device Management (MDM) but did not
I have read about NSPasteBoard in the Apple documentation, and how it allows for
I HAVE READ apple documentation and it's not understandable for such a beginner in
I have read on an article that Apple is applying a policy by which
I have read the Apple documentation. They list the apps registered, yet in their

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.