IPhone touchesEnded sometimes not called

I have a small game that needs to know when a user touches the screen and also when they release.
Now whilst I always get a touchesBegan event, sometimes I don't get the corresponding touchesEnded event (which is somewhat annoying).
Was just wondering if anyone else had seen this.

Hi, I've been wrestling with this problem for a few days now. I have something of a fix, which may help some of you, but it requires turning on the accelerometer.
First, it does seems as if the problem is that the timer events are crowding out touches and accelerometer events. But I've found a way to use the accelerometer update to avoid the problem.
Here is my workaround:
1. turn on the UIAccelerometer in your initialization code:
UIAccelerometer* theAccelerometer = [UIAccelerometer sharedAccelerometer];
theAccelerometer.delegate = self;
2. set the UIAccelerometer update interval to your desired frame rate:
theAccelerometer.updateInterval = .01667f;// ie, 60 fps
(For some reason — I am new to C — 1/60 doesn't seem to work, so I use floating decimals.)
3. Call your frame update method from within the UIAccelerometer update event:
- (void)accelerometer:(UIAccelerometer *)accelerometer didAccelerate:(UIAcceleration *)acceleration
[myView setNeedsDisplay];
The result is that myView should call drawRect as often as the UIAccelerometer updates. This may dip below your desired frame rate if things are too busy, but it seems to get as close to the rate you specify as possible. More importantly, it doesn't block touch events!
The downside, of course, is that you need to activate the accelerometer, which undoubtedly ***** up some resources (although I don't know how much.)
Anyway, I'd be curious to know if this works for anyone else.

Similar Messages

  • EventQueueMonitor: guiInitialized is sometimes not called?

    If waiting for gui initialized event in a java agent that is loaded before my applet, guiInitialized behavior is not stable.
    In some machine, it's invoked, but in a machine in it is not called.
    I don't whether this is a permission or configuration issue.
    I have grant the applet with java.security.AllPermission privilege.
    Can anyone give me a clue?
    Thanks very much!

    Sounds like a race condition. I would use instead:
    ( sleep 10 && /home/myusername/bin/setmouse) &
    And put those xinput lines into that new script (don't forget to chmod +x).
    I would also add to the top:
    export DISPLAY=":0.0"

  • KVO callback sometimes not called.

    Hi,
    I've developed an application where the framework (XGrid) sometimes does not seem to call the observerValueForKeyPath method everytime. Sometimes it works fine, other times I don't get the callbacks even though the value has changed. I was wondering if this could be some sort of threading issue? I found that when I initiated the code via the UI (IBAction) it seemed to be more reliable.
    Cheers,
    Marc.

    I'm not explicitly starting any threads. I'm guessing there is some sort of UI thread in cocoa, which will be differnt from the thread the app starts on. If I start the controller in via the app delegate ,and then start the job via an IBAction, I imagine these are two separate threads? Correct me if I'm wrong. It seems to be more stable in that scenario (but observerValueForKeyPath still sometimes does not get called).
    If I start the controller and the job both via the app delegate, it never seems to call observerValueForKeyPath.
    Marc.

  • In incoming call, why iphone 4S (ios 7.04) sometimes gives option to decline the call and sometimes not?

    In incoming call, why iphone 4S (ios 7.04) sometimes gives option to decline the call and sometimes not?

    Try to do this experience.
    Ask a person with a block phone to call you and the option to reject doesn´t appear. Try with a non-blocked phone and the option of reject appears.
    I think it´s an iOS 7 problem.

  • Why is my iPhone 4 still not updated to version 8.02. Why is that when l call/receive a call the person in the other end can't hear me while sometimes it works all perfect. Help guys

    l am using Iphone 4, l still did not receive update to version 8.02 and when l receive or call somebody the person in the other end can't hear me while sometimes its working perfectly normal. Help guyz any ideas

    The iPhone 4 is not capable of running iOS 8. iOS 8 requires a 4s or higher.

  • IPhone 4 does not make or receive calls/text at a location it used to.HELP!

    I started experiencing this sometime last week. It does not make any sense to me so I ask you. My phone does not make or receive phone calls and texts while I am at my workplace. It had worked find from when I got the phone (Late August) through January. If it stopped working completely I'd figure it was a dead zone or something, although they do not just pop up out of nowhere. But it works sporadically. Like if i got to send a text maybe 1 out of every 4 will work, same with receiving them. And this is the same with phone calls. I will receive a call, get through maybe 15 seconds of it, then the call gets dropped. Then for the remainder of the day (as I do not use it much during work) it will not receive a call, it goes right to voicemail. I have tested this by repeatedly calling my phone from my work landline. It rings fine on that end, so others wouldn't suspect I am having an issue, and goes to voicemail. I left a voicemail and my phone did not alert me to it for over 10 minutes (it never told me I had a missed call) During this timeframe I also attempted to make phone calls from my iPhone, they would not ring, it would immediately drop. But again, it is sporadic. So after 5 or 6 times of attempting making phone calls one goes through. I had made an appointment at the Apple Store the first day that this happened but once I was on the road to the store I got all my texts, voicemails, pictures that I had attempted to send earlier, so I thought it pointless since I had no real proof of this happening. But now it seems to happen everyday, it just happened which prompted me to write this. Again, its only at work, and only recently started happening. There is no cell tower issue, everyone elses phone works here. I have turned off the phone, both a soft and hard reset, reset network setting, turned off/on 3G, Cell Data, taken out the SIM, moved it, etc. Everything short of getting another phone, but it works perfectly fine everywhere else. Any ideas???

    I ended up taking my phone in to the Genius Bar, but we were unable to diagnose the problem. The genius said she had never seen anything like this before. We tried everything to figure out if it was hardware or software related, but never concluded anything. Instead of paying >$150 to fix/replace, I bought the iPhone5. iPhone5 is amazing. Maybe it was fate.

  • 2 iphones both receive same messages and sometimes phone calls. What causes this?

    My wife and I both have iphones but we are receiving each others messages and sometimes phone calls even though different phones. What is causing this? Both phones registered under the same user. Means she is seeing my texts messages and vice versa.

    If you are receiving imessages intended for other devices you can fix this by going to Settings>Messages>Send & Receive and do one of the following:
    Uncheck the email address shown under "You can be reached by iMessage at" on both devices if they are iPhones; or
    On one of the devices go to Settings>Messages>Send & Receive, tap the Apple ID, sign out, then sign in with a different Apple ID.  Note: you can continue to share an Apple ID for the iTunes & App store for purchasing if you wish; it does not need to be the same as the ID you use for iMessage, FaceTime, iCloud and other services.

  • My Iphone 5 sometimes is responsive and sometimes will not respond at all! help!

    Sometimes my Iphone works perfectly and then the next minute I can't even unlock it because the touch screen is being so unresponsive.  Then sometimes I unlcok it and then it gets unresponsive again.  Help.  Has anyone else been having this problem?  I Tried factory restoring it and it didn't seem to help.  Also, it seems the longer I leave my phone a lone then the longer it won't act up for.

    I have the same problem since is08 update! Just random crap consistently shuts down, no front camera, bluetooth dropouts, phone slow, phone  freezes, voice mails that are there and can not access, reset email that many times it's way past any sort of funny. This phone used to be awesome with not one single issue until the stupid update which to all you lucky iphoners that have no issues do not have any idea on how frustrating this is nor do you have any right to question a fellow iphoner about details of what is wrong and easy to say yeah just see apple!!! In the real world we are all busy with our own lives hence why the so called smart phone adapts to the individual to give each the personal experience and help us along the way which is all good when working.
    My iphone 5 is or was a very big part of running my business but not now, but as us is08 update users with issues are apparently a minority so apple have told me but as we all know just search and that may not be so true.
    Now don't get me wrong yes apple have addressed my issues after endless efforts to contact and was told phone would be sorted after updates!!! wrong!!!
    It's not easy to get time to make an appointment then get to a store to be told have you done the last update grrrrr have you backed up grrrr so back home and wait...... yes same same no change change thanks APPLE THIS IS ONE LONG TIME IPHONER THAT CAN NOT TAKE MUCH MORE

  • Iphone 5s does not transmit voice during phone calls

    iphone 5s does not transmit my voice during a phone call.  Just started happening.  The microphone works with Siri and the speaker works fine as I can hear the person I called.

    Hello there, Susina.
    The following Knowledge Base article has some great pointers for troubleshooting your issue:
    iPhone: Microphone issues
    http://support.apple.com/kb/ts5183
    Thanks for reaching out to Apple Support Communities.
    Cheers,
    Pedro.

  • I got problem when trying to contact my iphone 4 using facetime,it did ringing,but my iphone 4 did not receive that call as if nothing happen.But,when the call ended,that call appeared in the missed call list.fyi both are connected to internet.

    i got problem when trying to call my iphone 4 using facetime with my Macbook Pro 13',it did ringing,but my iphone 4 did not receive that call as if nothing happen.But,when the call ended,that call appeared in the missed call list.fyi both are connected to internet.Help!! thank you in advance

    i got problem when trying to call my iphone 4 using facetime with my Macbook Pro 13',it did ringing,but my iphone 4 did not receive that call as if nothing happen.But,when the call ended,that call appeared in the missed call list.fyi both are connected to internet.Help!! thank you in advance

  • My iphone 4 does not register calls made to it. if i make a call from another phone, i can hear it ringing, but it does not register on the iphone. also, i do not get any messages when this happens. then after a day or two it decides to start working.

    My iphone 4 does not register calls made to it. if i make a call from another phone, i can hear it ringing, but it does not register on the iphone. also, i do not get any messages when this happens. then after a day or two it decides to start working.

    Clean iPhone charging port with clean dry toothbrush. See if better. If still problem clean charging port again with toothbrush and small amount of Isopropyl Alcohol.

  • My iphone 3gs will not connect to itunes and it says that I need to do a system restore. It also says that I need to enter my password on the iphone to connect to itunes but I can not do this because the phone is in emergency phone call mode only.

    My iphone 3gs will not connect to itunes and it says that I need to do a system restore. It also says that I need to enter my password on the iphone to connect to itunes but I can not do this because the phone is in emergency phone call mode only.

    Turn your phone off and connect your cable to the computer, but not the device just yet. Start up iTunes. Now, hold down the home button on your phone and plug it in to the cable - don't let go of the button until iTunes tells you it's detected a phone in recovery mode. Now you can restore to factory settings.
    Unfortunately, the data on your phone is already gone if you're seeing the connect to iTunes logo.

  • I bought new i phone 5 3 days back, after that asked for new update which is 6.1.4, after updating my iphone i am not able to use cellular data services. I called up data provider, they says its the problem with new software update. There is no option add

    I bought new i phone 5 3 days back, after that asked for new update which is 6.1.4, after updating my iphone i am not able to use cellular data services. I called up data provider, they says its the problem with new software update. There is no option add APN. Now when i switch to safari its showing you are not subscribed for cellular data. But I am able to use data on other phone.
    Will you please help me in this regard?
    Another issue, since i bought my new iphone there is dust inside back main camera.
    Your advises are highly appreciated.

    Hey Shaiju isac,
    I'd take a look at the following article, it'll guide you though steps to you troubleshoot cellular data issues on your iPhone:
    iPhone: Troubleshooting a cellular data connection
    http://support.apple.com/kb/ts3780
    Cheers,
    David

  • After my iphone4S update to 7.0.6, it have a problem that keep searching network then no service show on display. Can't call. I have try check sim card, reset network settings, and restore my iphone. Still not working at all. Need help please.

    After my iphone4S update to 7.0.6, it have a problem that keep searching network then no service show on display. Can't call. I have try check sim card, reset network settings, and restore my iphone. Still not working at all. Need help please.Urgent.TQ

    Izit software or hardware? Confuse:(
    Only can use wifi now.
    Any way thanks guys for ur suggestion:) amishcake and simes

  • My iphone is gray or black it is functioning but you can not see the screen so I can not call or text or anything

    My iphone is gray or black it is functioning but you can not see the screen so I can not call or text or anything,  I have a child that is very ill and I have to have access to a phone at all times can someone help me?  It happened one other time when I plugged it in to my to listen to music.  I know it is working it said something on voice control.  I tried the press the circle button and the top button but the screen only turned white?

    Try the following:
    - A reset. Nothing is lost
    Reset iPod touch: Hold down the On/Off button and the Home button at the same time for at
    least ten seconds, until the Apple logo appears.
    - Restore from backup
    - Restore to factory settings/new iPod.
    If you still have the problem that indicates a hardware problem and an appointment at the Genius Bar of an Apple store is in order

Maybe you are looking for

  • How to edit a pfd document then save using Preview?

    I received a form in pdf format. I need to fill out some blanks with text and e-mail it back to the sender. I could not figure it out using Preview. Actually I tried the Adobe acrobat reader also and had zero success. Thanks Bob

  • 10g deployment problems

    Using Jdev 10g, I created a simple ADF UIX/BC4j web application (excepting all the defaults). Even though it is deployed to iAS 10g, the ear file needs to be self contained, so I included the default libraries in the deployment profile. I received th

  • Qosmio F20: How to install the bluetooth card?

    Hello, Can you help please ? I have ordered few weeks ago an usb bluetooth but on the phone the seller told me that the version that I ordered has been replaced by a new one PA3477U-28TM but it's a bluetooth card and I don't know how to install it. D

  • .War file size too large on Sun One WebServer 6.1

    We are using Sun One Web Server 6.1. I am trying to deploy a .war file thru the admin interface, and it fails due to the .war file being too large (over 10 megs). I am new to this server and have been looking around to see if there is a config settin

  • How to Debug CCM Catalog Upload Process

    SRM Gurus, Can anyone please outline the steps to debug the uploading process of the .CSV file in CCM 2.0? The upload of my supplier catalog terminated due to an error and I'd like to debug to see what's causing the error. Any tips would be greatly a