Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Tutorials > Tutorial Discussion

Reply
 
LinkBack Thread Tools Display Modes
Old 04-21-2010, 04:39 PM   #1 (permalink)
Registered Member
 
Join Date: Mar 2010
Location: riyadh
Posts: 7
KSA_girl is on a distinguished road
Default actionsheet

hi..

i have a problem in actionsheet.
how i can add more then ONE button ? I want to add 6 buttons !

this is my code:
Code:
-(IBAction)showActionSheet {
	UIActionSheet *actionSheet = [[UIActionSheet alloc] initWithTitle:@"what you want to do" delegate:self cancelButtonTitle:@"Cancel" destructiveButtonTitle:@"Mark as ToDo" otherButtonTitles:nil];
	[actionSheet showInView:self.view];
	[actionSheet release];
}
when I write something in otherButtonTitles .. the program is crash !!

please help me as soon as possible ..
KSA_girl is offline   Reply With Quote
Old 04-21-2010, 05:10 PM   #2 (permalink)
Registered Member
 
Join Date: Apr 2009
Posts: 110
Mike J is on a distinguished road
Default

Quote:
Originally Posted by KSA_girl View Post
hi..

i have a problem in actionsheet.
how i can add more then ONE button ? I want to add 6 buttons !

this is my code:
Code:
-(IBAction)showActionSheet {
	UIActionSheet *actionSheet = [[UIActionSheet alloc] initWithTitle:@"what you want to do" delegate:self cancelButtonTitle:@"Cancel" destructiveButtonTitle:@"Mark as ToDo" otherButtonTitles:nil];
	[actionSheet showInView:self.view];
	[actionSheet release];
}
when I write something in otherButtonTitles .. the program is crash !!

please help me as soon as possible ..

Alright, if you want to use the otherButtonTitles, you have to put in all of your buttons and then put in nil, so the code knows when to stop adding buttons.

Here is an example
Code:
-(IBAction)showActionSheet {
	UIActionSheet *actionSheet = [[UIActionSheet alloc] initWithTitle:@"what you want to do" delegate:self cancelButtonTitle:@"Cancel" destructiveButtonTitle:@"Mark as ToDo" otherButtonTitles:@"Another Button", @"The Other Button", nil];
	[actionSheet showInView:self.view];
	[actionSheet release];
}
Mike J is offline   Reply With Quote
Old 04-21-2010, 06:11 PM   #3 (permalink)
Registered Member
 
Join Date: Mar 2010
Location: riyadh
Posts: 7
KSA_girl is on a distinguished road
Default

thank you very much for quick reply ..


I have another question please ..
can I change the colors for the buttons ? or at least remove the red color in the first button ?

Last edited by KSA_girl; 04-21-2010 at 06:38 PM.
KSA_girl is offline   Reply With Quote
Reply

Bookmarks

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



» Advertisements
» Stats
Members: 175,696
Threads: 94,139
Posts: 402,959
Top Poster: BrianSlick (7,990)
Welcome to our newest member, jasper_muc
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 01:55 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0