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 February 2nd, 2011, 07:31 PM
Registered User
Join Date: Jan 2011
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default Action sheet in Chapter 3

On page 52, under the subheading "Using The Action Sheet," There's a useable example there. I'm a little bit confused, however, as to where the bits of code are supposed to go.

UIActionSheet *action = [[UIActionSheet alloc]
initWithTitle:@"Title of Action Sheet"
delegate: self
destructiveButtonTitle:@"Delete Message"
otherButtonTitles:@"Option 1", @"Option 2", nil];

[action showInView:self.view];
[action release];
and this:

-(void)actionSheet:(UIActionSheet *)actionSheet:
NSLog(@"%d", buttonIndex);
I also don't really understand why the viewDidLoad method doesn't work on the ipad, or how to translate it into an IBAction method. If anyone could help me with any of these things, I would really appreciate it.

Reply With Quote
  #2 (permalink)  
Old February 3rd, 2011, 12:05 AM
Friend of Wrox
Points: 1,671, Level: 16
Points: 1,671, Level: 16 Points: 1,671, Level: 16 Points: 1,671, Level: 16
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
Join Date: Aug 2010
Posts: 298
Thanks: 1
Thanked 62 Times in 60 Posts

Unfortunately, there is not a practical example given for the use of the ActionSheet in the book. The call for the ActionSheet should be in whatever method needs the responses. iCal on iPad uses them, for example, when changing repeating events.

the -(void)actionSheet… method is a delegate method and should be in whatever file you have made the delegate of the actionSheet. Make sure that the file conforms to the delegate protocol.

I don't have this book, but the project was in an earlier book by the author, so I am not sure what you mean by
doesn't work on iPad. It does. It may not always be called when you start the program, (it will be the first time the program is run) since the program maintains the state it was in when you last left it. This is tied into the introduction of multitasking. My post on December 15 in this thread
Chapter 4 - Switching Views
offers a little more explanation, and points to some useful info in the documentation.
Also, not clear what you mean about changing -viewDidLoad into an IBAction method.
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 3: using the Action Sheet (pg. 52) iamdavidstone BOOK: Beginning iOS 4 Application Development 1 December 31st, 2010 02:37 PM
Open Workbook,Copy Sheet,Move Sheet, Close/Save ptrussell2009 Excel VBA 0 June 13th, 2008 02:28 PM
access function in data sheet(another sheet) jani Excel VBA 1 May 21st, 2008 07:15 PM
Chapter 2 -- Style Sheet problem. Doug Happ BOOK: Beginning ASP.NET 2.0 BOOK VB ISBN: 978-0-7645-8850-1; C# ISBN: 978-0-470-04258-8 4 January 10th, 2008 01:14 PM
Request action on change and get no action. Help crussell Ajax 0 September 12th, 2007 11:11 AM

All times are GMT -4. The time now is 09:58 PM.

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