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 7072973
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T05:52:25+00:00 2026-05-28T05:52:25+00:00

I am porting an app that I originally wrote using the accelerometer for IOS

  • 0

I am porting an app that I originally wrote using the accelerometer for IOS 3, to incorporate the new IOS 4 motion capabilities.

While capturing motion, the application does little else – no graphics updates for example.

I’m doing the following to set up motion updates, as a replacement for my previous use of the accelerometer. I do realize that I could rebuild to do my own polling using NSTimer or something, and may pursue that yet.


[motionManager setDeviceMotionUpdateInterval:updateInterval];

CMDeviceMotionHandler motionHandler = ^(CMDeviceMotion *motion, NSError *error) {
[self processMotion:motion withError:error];
};

[motionManager startDeviceMotionUpdatesToQueue:[NSOperationQueue currentQueue] withHandler:motionHandler];

This works, but the update interval doesn’t behave as expected. I’ve stripped out all execution code in the processMotion method, except for saving off timestamps in order to see what the real motion update rate is. I’ve tested this enough to prove to myself that it’s repeatable, even the strange result for 1/40. The table below shows what I’m seeing:

updateInterval  actual events per second
1.0/20.0        13
1.0/30.0        27
1.0/40.0        27
1.0/50.0        34
1.0/60.0        40
1.0/70.0        57
1.0/90.0        60
1.0/100.0      74

Some notes:
1. i’m sure that the update interval is being set properly, and have checked it after setting to confirm.

2. I’m sure that I’m tracking every call of processMotion, there aren’t any calls being made with nil CMDeviceMotion or other strangeness

3. I’m not doing any significant processing that would block things, just waiting on motion events and recording them. This all worked perfectly fine as a delegate for the accelerometer

4. the motion data is good, just too infrequently updated 🙂

5. this is using ios 4.2 on an ipod touch 4th gen

6. I’ve searched as best I can, haven’t seen an explanation, though i have seen some reports of people seeing 50hz update frequency when requesting 60hz, which could be related.

The next thing i’ll try is setting up a dedicated queue for the processing instead of using the current queue, however I did want to see if this was a known behavior. I could understand if the update rate was bottlenecked somehow, but not sure why it would still scale up as shown if that was the case.

Again, I suppose I could rebuild to use NSTimer and do my own polling, but I’d like to understand why i’m seeing this, in case i’m fundamentally misunderstanding the Core Motion framework.

  • 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-05-28T05:52:25+00:00Added an answer on May 28, 2026 at 5:52 am

    Okay, here’s a possible solution:

    Number of concurrent operations on NSOperationQueue are determined by the OS. That means it sometimes can be very few or even 1 operation at a time.

    You can explicitly set the number of operations to a certain reasonable number, e.g.

    [operationQueue setMaxConcurrentOperationCount:5];
    

    Enjoy.

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

Sidebar

Related Questions

I have a console app that I'm porting to WPF. The application has 3
I'm in the process of porting an app originally developed on iOS to Android.
I'm porting a app to FreePasal/Lazarus & found that their form converter is not
I recently inherited an e-commerce app (Java/Struts) that I'm porting to Rails. The thing
I am porting a Web App to a new environment. Due to changed paths,
I've got a web app that I'm porting to an OS X Dashboard widget.
I'm porting my Flex3 app to Flex4 (FlashBuilder4). I get the whole new state
I'm porting a rails app to grails that uses oauth to push messages to
I'm porting a Windows app written in C# to Mac OS using Java and
I'm currently porting an app that was written for Windows Mobile 2003 (compact framework

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.