Register FAQ / Rules Forum Spy Search Today's Posts Mark Forums Read
Go Back   MacRumors Forums > Apple Systems and Services > Programming > iPhone/iPad Programming

Thread Tools Search this Thread Display Modes
Old Aug 3, 2011, 05:42 PM   #1
macrumors 6502
Join Date: Jun 2010
Location: Baltimore, MD
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.
mms13 is offline   0 Reply With Quote
Old Aug 3, 2011, 06:29 PM   #2
macrumors 65816
Join Date: Dec 2010
Location: Sydney
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?
jiminaus is offline   0 Reply With Quote
Old Aug 4, 2011, 09:10 AM   #3
Thread Starter
macrumors 6502
Join Date: Jun 2010
Location: Baltimore, MD
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.
mms13 is offline   0 Reply With Quote

MacRumors Forums > Apple Systems and Services > Programming > iPhone/iPad Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
thread Thread Starter Forum Replies Last Post
iCloud email works via but not in OSX/iOS HXGuy iCloud and Apple Services 0 Oct 13, 2011 01:49 AM
IPhone 3G YouTube Quality Is Poor But Not Via WiFi. Why? BruceEBonus iPhone Tips, Help and Troubleshooting 21 Nov 16, 2010 10:24 AM
Leopard recognizes HP printer via AirPort Express, but NOT driver sina10 Mac Peripherals 0 Jan 29, 2010 03:03 PM
Network does not work, can ping sites but not browse web on any browser MarkGX OS X 8 Aug 31, 2006 04:41 PM
BitTorren works over 56k modem but not school network via ethernet motulist Mac Applications and Mac App Store 3 Feb 18, 2004 02:56 AM

All times are GMT -5. The time now is 06:42 PM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013,, LLC