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

Mockup & CodeGen, iPhone & iPad
($9.99)

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

Manu
($0.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum

View Single Post
Old 08-25-2008, 11:33 PM   #1 (permalink)
trifusion
Registered Member
 
Join Date: Apr 2008
Posts: 17
Default 2 button UIAlertView - which button was pressed?

Can someone please post a simple example of how to do an alert (UIAlertView) with an OK and Cancel button and how I could simply change detect which button was pressed?

When I read the docs it would appear that I may have to create a UIAlertView delegate and being a Cocoa newbie I am not sure how to go about doing that.

I can display the alert with two buttons using:

Code:
		UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Title" message:@"AThe message."  delegate:self cancelButtonTitle:@"button 1" otherButtonTitles: @"button", nil];
		[alert show];
		[alert release];
But how do I determine which button was pressed?

Thanks

Greg
trifusion is offline   Reply With Quote
 

» Advertisements
» Online Users: 655
15 members and 640 guests
alphy, apatsufas, ckgni, Dani77, Domele, drewrico, handmachine, hiddendemo, JamesCahall, mistergreen2011, Monstertaco, noobAppDeveloper, Oral B, rimap123, rrlemoine
Most users ever online was 1,187, 10-11-2011 at 08:09 AM.
» Stats
Members: 158,787
Threads: 89,205
Posts: 380,602
Top Poster: BrianSlick (7,129)
Welcome to our newest member, rimap123
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 12:25 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.