iOS7 - CMStepCounter Class Issues - ios

does anyone know if it would be possible to call the CMStepUpdateHandler block without waiting for the quoted number of steps?
The reason I want this, is that if the user starts the startStepCountingUpdatesToQueue:updateOn:withHandler: and suspends the app, only to reopen AFTER they have finished walking, the step count will not update as it is necessary to then walk the quoted number of steps with the app in the foreground before the steps are displayed.
Any help greatly appreciated.
PS, see here for documentation... https://developer.apple.com/LIBRARY/IOS/documentation/CoreMotion/Reference/CMStepCounter_class/Reference/Reference.html

Having researched this, it seems the behaviour above is default, and so opted to use the CMStepCounter query option.

Related

how to know that where exactly app getting stuck in xcode?

My app gets stuck for a specific operation and that operation is too big having so many method calls and services requests, so i cannot put breakpoints on each method and debug, is there any other way i can get to know where exactly my app is stucked in xcode?
The operation wasn't too big to write the code, so it isn't too big to add breakpoints, logging statements, assertions and so on.
The only other way that works sometimes is taking a long shower in the morning, not thinking about work at all, and suddenly the realisation what you did wrong jumps to your mind. It has worked for me sometimes, but the first method is more reliable.
If you have reason to believe that the most time is spent in one operation, just let it run with the debugger attached and then press the pause button and see where you are...
A somewhat niftier approach would be to start with Instruments (i.e. the Time Profiler). It's easy to use and should be the first weapon of your choice for performance issues.
You can set a conditional break point in Xcode to debug a specific condition, for more detail go through Jeffrey Sambells blog!

Thread that work in background of project until the end of program

I need to write a thread that do work in background of project.
when should I create it and where , for example in AppDelegate or others?
if I want to run thread when user do a job,for example when click on a button run a thread that work in background until the end of program,for this what should I do?
In iOS, a program never ends unless it crashes or the user turns their phone off. So running "until the end of program" is a very, very long time. Users will not thank you for emptying their battery.
It is most likely that what you are asking for is by far not the best possible solution, and will be rejected if you want to put your app into the app store. You should really explain what it is that you are actually trying to achieve.
In case you just posted the wrong question, the answer is "use GCD". If you don't know what GCD is, Google and Apple's documentation are your friend.

Executing tasks while app is active and in background

I need to scan a website for changes every few minutes and when difference occurs i need inform user with popout window that contains information about that change.
Problem is i can't find solution to that, i tried putting that code in applicationDidEnterBackground but it didnt work. I'm new to swift and mobile programming at all so please be understanding.
Where should i begin? Little tip maybe.
Thank you!

How to access Iphones call timer

this is my first time posting so if I make a mistake correct me please!
I am currently brain-storming an app, and as I have been researching part of it on here, and other places I have come to a bit of a snag. I want the app to be able to access the call timer on a iPhone (as in, it will be able to track how long you are in a call) and then store this information. As of 2011 it seems that this was either not possible, or you had to use something called CoreTelephony. I however could not find any recent material on this, so I was wondering if anything has changed in recent years.
Thanks in advance for any help!
If your trying to count/show how long someone has spent on the phone from the iphone usage data you cannont, If you are trying to show how long someone has been on the phone in your app using your phone/voip or what ever you use then you can use NSTimer

App freezing after voice call

I've made an application that is pretty simple, it just lets the user capture a number and then saves it in a SQLite DB.
Sometimes, not very common thing, when the user is entering the number to save in my app and he receives a call, answers the call, and then finishes it, the application is frozen after the call, can't do anything on it, not even return to the previous screen.
Does anybody have a clue on what can this be?
The code in this application is so simple =/, I have no idea what could it be.
Thanks in advance!!
How is it frozen? Have you attached the debugger and looked at your processes/threads to see what they are doing?
Could it be a painting issue rather than true freezing?
Need more information.

Resources