|Aug 3, 2011, 05:42 PM||#1|
motionBegan (shake) works via XCode run, but not via distribution!
I'm experiencing a very weird issue with my app:
I'm going about the standard way of detecting a shake event. I have implemented the canBecomeFirstResponder method, and I call becomeFirstResponder in viewDidAppear and resignFirstResponder in viewWillDisappear. Then I implement the motionBegan method to handle the shake events.
When I build and run my application onto my device through XCode, everything works great. The motionBegan event fires and my program properly handles the shake event. All good, so I submitted my application. I was shocked to find out that when I downloaded it from the App Store, that my shake events weren't working! Now, in trying to fix this problem, I've also found that it doesn't work if I archive my app as an .ipa file and then load it onto my phone through iTunes.
In short, the shake event fires through a run on XCode, but not when it's been put onto a device via distribution methods!
This doesn't make any sense to me so I'm really hoping someone knows what's wrong!
PS - this issue occurs regardless of how application.applicationSupportsShakeToEdit is set.
|Aug 3, 2011, 06:29 PM||#2|
Sounds like an issue because caused by debug build verses release build. Release build turns on compiler optimisations, which can expose bugs that aren't apparent without optimisations. Which version of XCode are you using?
|Aug 4, 2011, 09:10 AM||#3|
Well, I was using XCode 4.2 to build on my iOS 5 device. Then I would open the project in XCode 4.0.2 to archive/submit to iTunes Connect. Perhaps that was the issue.
But anyway, I fixed the problem by using the motionEnded() event handler as opposed to motionBegan(). Maybe motionBegan can't detect the shake event? Either way though it's weird that it works in debug but not release.
|Thread Tools||Search this Thread|
|thread||Thread Starter||Forum||Replies||Last Post|
|Xcode won't run my programs any more||KarlJay||iPhone/iPad Programming||6||Nov 14, 2013 12:43 PM|
|What's the oldest version of OS X you still run Xcode 4 on?||ArtOfWarfare||Mac Programming||8||Jun 17, 2013 06:15 PM|
|Anyone works with Xcode 4.5.1 in MBPr?||jffluis||MacBook Pro||7||Oct 23, 2012 09:52 AM|
|app only works when debugging inside xcode?||bajsko||Mac Programming||4||Aug 8, 2012 11:41 AM|
All times are GMT -5. The time now is 09:22 PM.