Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | 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
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old November 14th, 2011, 10: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.

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

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Chapter 13 decompression error 0x80010135 - Path too Long whunter31 BOOK: Professional WCF 4: Windows Communication Foundation with .NET 4 6 July 27th, 2017 09:13 AM
Chapter 14, first 'Try It Out' alharlow BOOK: Beginning ASP.NET 4 : in C# and VB 5 March 18th, 2011 05:00 AM
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 12:36 PM
Chapter 14 Mike Smith BOOK: Professional C#, 2nd and 3rd Editions 2 January 4th, 2004 05:13 PM

All times are GMT -4. The time now is 10:15 AM.

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