Wrox Programmer Forums
|
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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
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.

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

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

Quote:
-(void)actionSheet:(UIActionSheet *)actionSheet:
clickedButtonAtIndex:(NSInteger)buttonIndex{
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.

Thanks!
 
Old February 3rd, 2011, 12:05 AM
Friend of Wrox
 
Join Date: Aug 2010
Posts: 298
Thanks: 1
Thanked 62 Times in 60 Posts
Default

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
-viewDidLoad
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.





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





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