[SOLVED] Re: iOS: getting the shakes
On 01/06/2011, at 2:19 PM, Roland King wrote: > s your uiresponder the first responder? Aha! No, it wasn't :) Thanks - it's working now. --Graham ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: iOS: getting the shakes
Is your uiresponder the first responder? On Jun 1, 2011, at 11:35, Graham Cox wrote: > In my IOS app, I'm overriding -motionBegan:withEvent: in my view controller, > trying to receive shake events. But it's never called (iOS simulator, version > 4.3). > > Is there something else I need to do to specifically enable delivery of shake > events? I have scoured the docs but didn't find anything relevant. > > --Graham > > > ___ > > Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) > > Please do not post admin requests or moderator comments to the list. > Contact the moderators at cocoa-dev-admins(at)lists.apple.com > > Help/Unsubscribe/Update your Subscription: > http://lists.apple.com/mailman/options/cocoa-dev/rols%40rols.org > > This email sent to r...@rols.org ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: iOS: getting the shakes
On 01/06/2011, at 1:55 PM, David Rowland wrote: > I think you want, > > - (void)motionEnded:(UIEventSubtype)motion withEvent:(UIEvent *)event > > You make a subclass of UIView, instantiate it, and implement the above within > that subclass. Hmm, thanks but it's still not called. I have a subclass of UIView, and also a subclass of UIViewController. The controller is part of the responder chain after the view, so it *should* be called whether the view or the controller implements the method. Other events such as touches are passed along as expected, which is why I wondered if there's something else needed to enable shake events (e.g. a specific key in the info.plist). --Graham ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: iOS: getting the shakes
That should be a subclass of UIResponder. You don't need a UIView, but I suppose you could use an existing one. D On May 31, 2011, at 8:55 PM, David Rowland wrote: > It's an iOS device, not a computer. No mouse, no keyboard. > > I think you want, > > - (void)motionEnded:(UIEventSubtype)motion withEvent:(UIEvent *)event > > You make a subclass of UIView, instantiate it, and implement the above within > that subclass. > > David > > > > > > On May 31, 2011, at 8:42 PM, Eli Bach wrote: > >> >> On May 31, 2011, at 9:35 PM, Graham Cox wrote: >> >>> In my IOS app, I'm overriding -motionBegan:withEvent: in my view >>> controller, trying to receive shake events. But it's never called (iOS >>> simulator, version 4.3). >>> >>> Is there something else I need to do to specifically enable delivery of >>> shake events? I have scoured the docs but didn't find anything relevant. >>> >>> --Graham >> >> Well, how hard did you shake your computer? You have to actually shake the >> computer, as neither your mouse nor your keyboard have a motion sensor. >> >> Eli >> >> ___ >> >> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) >> >> Please do not post admin requests or moderator comments to the list. >> Contact the moderators at cocoa-dev-admins(at)lists.apple.com >> >> Help/Unsubscribe/Update your Subscription: >> http://lists.apple.com/mailman/options/cocoa-dev/rowlandd%40sbcglobal.net >> >> This email sent to rowla...@sbcglobal.net > > ___ > > Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) > > Please do not post admin requests or moderator comments to the list. > Contact the moderators at cocoa-dev-admins(at)lists.apple.com > > Help/Unsubscribe/Update your Subscription: > http://lists.apple.com/mailman/options/cocoa-dev/rowlandd%40sbcglobal.net > > This email sent to rowla...@sbcglobal.net ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: iOS: getting the shakes
On 01/06/2011, at 1:42 PM, Eli Bach wrote: > Well, how hard did you shake your computer? You have to actually shake the > computer, as neither your mouse nor your keyboard have a motion sensor. > > Eli You're a funny guy. :) I assume you are being funny: the simulator has a "shake" menu command to simulate the shake event. I'm sure you know that, but just in case... --Graham ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: iOS: getting the shakes
It's an iOS device, not a computer. No mouse, no keyboard. I think you want, - (void)motionEnded:(UIEventSubtype)motion withEvent:(UIEvent *)event You make a subclass of UIView, instantiate it, and implement the above within that subclass. David On May 31, 2011, at 8:42 PM, Eli Bach wrote: > > On May 31, 2011, at 9:35 PM, Graham Cox wrote: > >> In my IOS app, I'm overriding -motionBegan:withEvent: in my view controller, >> trying to receive shake events. But it's never called (iOS simulator, >> version 4.3). >> >> Is there something else I need to do to specifically enable delivery of >> shake events? I have scoured the docs but didn't find anything relevant. >> >> --Graham > > Well, how hard did you shake your computer? You have to actually shake the > computer, as neither your mouse nor your keyboard have a motion sensor. > > Eli > > ___ > > Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) > > Please do not post admin requests or moderator comments to the list. > Contact the moderators at cocoa-dev-admins(at)lists.apple.com > > Help/Unsubscribe/Update your Subscription: > http://lists.apple.com/mailman/options/cocoa-dev/rowlandd%40sbcglobal.net > > This email sent to rowla...@sbcglobal.net ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: iOS: getting the shakes
On May 31, 2011, at 9:35 PM, Graham Cox wrote: > In my IOS app, I'm overriding -motionBegan:withEvent: in my view controller, > trying to receive shake events. But it's never called (iOS simulator, version > 4.3). > > Is there something else I need to do to specifically enable delivery of shake > events? I have scoured the docs but didn't find anything relevant. > > --Graham Well, how hard did you shake your computer? You have to actually shake the computer, as neither your mouse nor your keyboard have a motion sensor. Eli ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com