Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


Gesture recognition causes my app to crash.


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
4 replies to this topic

#1 blueshogun96   Crossbones+   -  Reputation: 1089

Like
0Likes
Like

Posted 27 August 2014 - 10:13 AM

I'm still pretty new to gesture recognition, and I've never needed it until now.  So, I've found various examples on the net, and when I try to implement it, my app just crashes when I touch the screen.  So anyway, this is what I did.

 

I added this to viewDidLoad

// Create and initialize a tap gesture
    UITapGestureRecognizer *tapRecognizer = [[UITapGestureRecognizer alloc]
                                             initWithTarget:self action:@selector(respondToTapGesture:)];
    
    // Specify that the gesture must be a single tap
    tapRecognizer.numberOfTapsRequired = 1;
    
    // Add the tap gesture recognizer to the view
    [self.view addGestureRecognizer:tapRecognizer];

Then I added this to the ViewController

- (void)respondToTapGesture:(UIGestureRecognizer *)gesture
{
    // Do whatever
}

What happens is I get a crash.  More specifically, I get an EXC_BAD_ACCESS.

 

Screen Shot 2014-08-27 at 9.11.42 AM.png

 

That's the stack trace, if that helps.  I have absolutely no idea why this isn't working, when all of the examples appear to be working fine.  Did I forget to add something to plist?

 

Shogun.


Follow Shogun3D on the official website: http://shogun3d.net

 

blogger.png twitter.png tumblr_32.png facebook.png

 

"Yo mama so fat, she can't be frustum culled." - yoshi_lol


Sponsor:

#2 L. Spiro   Crossbones+   -  Reputation: 14197

Like
0Likes
Like

Posted 28 August 2014 - 09:34 PM

Ensure that your device is running iOS 3.2 or greater.


L. Spiro
It is amazing how often people try to be unique, and yet they are always trying to make others be like them. - L. Spiro 2011
I spent most of my life learning the courage it takes to go out and get what I want. Now that I have it, I am not sure exactly what it is that I want. - L. Spiro 2013
I went to my local Subway once to find some guy yelling at the staff. When someone finally came to take my order and asked, “May I help you?”, I replied, “Yeah, I’ll have one asshole to go.”
L. Spiro Engine: http://lspiroengine.com
L. Spiro Engine Forums: http://lspiroengine.com/forums

#3 blueshogun96   Crossbones+   -  Reputation: 1089

Like
0Likes
Like

Posted 28 August 2014 - 09:36 PM

Ensure that your device is running iOS 3.2 or greater.


L. Spiro

 

My device is running iOS 7.1.2.  Since our last topic we've engaged regarding iOS devices, I've gotten my hands on a more modern iPhone.

 

Shogun.


Follow Shogun3D on the official website: http://shogun3d.net

 

blogger.png twitter.png tumblr_32.png facebook.png

 

"Yo mama so fat, she can't be frustum culled." - yoshi_lol


#4 L. Spiro   Crossbones+   -  Reputation: 14197

Like
2Likes
Like

Posted 28 August 2014 - 09:40 PM

https://developer.apple.com/library/ios/documentation/uikit/reference/UIGestureRecognizer_Class/Reference/Reference.html#//apple_ref/occ/cl/UIGestureRecognizer
Read Usage Special Considerations and add a run-time check to get more information about its capabilities.

 

 

L. Spiro


It is amazing how often people try to be unique, and yet they are always trying to make others be like them. - L. Spiro 2011
I spent most of my life learning the courage it takes to go out and get what I want. Now that I have it, I am not sure exactly what it is that I want. - L. Spiro 2013
I went to my local Subway once to find some guy yelling at the staff. When someone finally came to take my order and asked, “May I help you?”, I replied, “Yeah, I’ll have one asshole to go.”
L. Spiro Engine: http://lspiroengine.com
L. Spiro Engine Forums: http://lspiroengine.com/forums

#5 L. Spiro   Crossbones+   -  Reputation: 14197

Like
1Likes
Like

Posted 29 August 2014 - 04:11 AM

Erica Sadun is a friend of mine who helped me get my book deal and has given me advice on writing my first book.

She wrote this:

http://www.drdobbs.com/mobile/handling-touch-input-on-ios6/240144075

 

I haven’t used gestures directly as they are not useful in video games, but that covers the subject fairly exhaustively and may be of help.

 

 

L. Spiro


It is amazing how often people try to be unique, and yet they are always trying to make others be like them. - L. Spiro 2011
I spent most of my life learning the courage it takes to go out and get what I want. Now that I have it, I am not sure exactly what it is that I want. - L. Spiro 2013
I went to my local Subway once to find some guy yelling at the staff. When someone finally came to take my order and asked, “May I help you?”, I replied, “Yeah, I’ll have one asshole to go.”
L. Spiro Engine: http://lspiroengine.com
L. Spiro Engine Forums: http://lspiroengine.com/forums




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS