Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 05-05-2011, 10:35 AM   #1 (permalink)
Registered Member
 
Join Date: Mar 2011
Posts: 60
nathanl1192 is on a distinguished road
Default Please check this MotionShake for errors. - Not working.

Hi there,

I am running this code, using the SIMULATOR, and it is not working when I tell the simulator to perform a shake gesture. Is the reason it is not working the fact that I am using the simulator, or is the code wrong.

Code:
-(void)motionBegan:(UIEventSubtype)motion withEvent:(UIEvent *)event {
    
    if(event.type == UIEventTypeMotion && event.subtype == UIEventSubtypeMotionShake)
    uitextview1.text = @"TEST SHAKE";
           
            
        
    
    
}
Thanks so much!
nathanl1192 is offline   Reply With Quote
Old 05-05-2011, 11:10 AM   #2 (permalink)
Registered Member
 
ebender001's Avatar
 
Join Date: Mar 2010
Location: Missouri
Age: 57
Posts: 70
ebender001 is on a distinguished road
Default

Quote:
Originally Posted by nathanl1192 View Post
Hi there,

I am running this code, using the SIMULATOR, and it is not working when I tell the simulator to perform a shake gesture. Is the reason it is not working the fact that I am using the simulator, or is the code wrong.

Code:
-(void)motionBegan:(UIEventSubtype)motion withEvent:(UIEvent *)event {
    
    if(event.type == UIEventTypeMotion && event.subtype == UIEventSubtypeMotionShake)
    uitextview1.text = @"TEST SHAKE";
           
            
        
    
    
}
Thanks so much!

Make sure you return YES from -(BOOL)canBecomeFirstResponder method of your view controller

Ed
ebender001 is offline   Reply With Quote
Old 05-05-2011, 01:42 PM   #3 (permalink)
Reading the Documentation
 
baja_yu's Avatar
 
Join Date: Sep 2010
Location: 45.255019,19.844908
Posts: 5,414
baja_yu has a spectacular aura about
Default

Don't make multiple threads for the same question. You already had one for this here: http://www.iphonedevsdk.com/forum/ip...ice-shake.html
baja_yu is offline   Reply With Quote
Reply

Bookmarks

Tags
ios, shake, simulator, uieventsubtypemotionshake

Thread Tools
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
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 353
10 members and 343 guests
dansparrow, iOS.Lover, lorrettaui53, MikaelBartlett, Nobbsy, oztemel, pbart, PlutoPrime, thephotographer, Trickphotostudios
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,663
Threads: 94,120
Posts: 402,898
Top Poster: BrianSlick (7,990)
Welcome to our newest member, LezB44
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 01:56 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0