Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Beginning iOS 4 Application Development
This is the forum to discuss the Wrox book Beginning iOS 4 Application Development by Wei-Meng Lee; ISBN: 978-0-470-91802-9
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning iOS 4 Application Development section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old November 14th, 2011, 09:18 PM
Registered User
Points: 8, Level: 1
Points: 8, Level: 1 Points: 8, Level: 1 Points: 8, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Nov 2011
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Chapter 14 - Long Press

While testing out the example I found that I needed to tap the buttons twice. Thought it was something I did until I tested the sample code from the chapter and it did the same thing. After doing some research (for several hours) I found the solution. Modify the handleLongpressGesture and wrap it in the if (sender.state == UIGestureRecognizerStateBegan) block. Evidently since it is a "continuous gesture" it must be checked to see if the state began. Once I did that - viola - it worked perfectly. Just thought I'd post since it might help someone else out.

Code:
//handle Long Press Gestures
-(IBAction)handleLongpressGesture:(UIGestureRecognizer *) sender {
    if (sender.state == UIGestureRecognizerStateBegan) {
	UIActionSheet *actionSheet=[[UIActionSheet alloc]
			initWithTitle:nil 
			delegate:self 
			cancelButtonTitle:@"Cancel" 
			destructiveButtonTitle:nil
			otherButtonTitles: @"Save Image",nil];
    actionSheet.actionSheetStyle=UIBarStyleBlackTranslucent;
	[actionSheet showInView:self.view];	
	[actionSheet release];
    }
}
Reply With Quote
Reply


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 Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Chapter 14, first 'Try It Out' alharlow BOOK: Beginning ASP.NET 4 : in C# and VB 5 March 18th, 2011 05:00 AM
Chapter 13 decompression error 0x80010135 - Path too Long whunter31 BOOK: Professional WCF 4: Windows Communication Foundation with .NET 4 1 June 24th, 2010 06:36 PM
chapter 14 vthunder70 BOOK: Beginning ASP.NET 2.0 and Databases 2 October 3rd, 2007 02:11 PM
Modifying long text in a long field sajsal Classic ASP Databases 1 February 20th, 2004 11:36 AM
Chapter 14 Mike Smith BOOK: Professional C#, 2nd and 3rd Editions 2 January 4th, 2004 04:13 PM



All times are GMT -4. The time now is 09:08 AM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.