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-23-2009, 06:38 AM   #6 (permalink)
sohel62
Registered Member
 
Join Date: Jul 2009
Posts: 3
Thumbs up

Thank for the post, header file information was useful for me.
I was missing that.

Quote:
Originally Posted by Stitch View Post
This is taken from the UICatalog sample code.

Insure your header file contains the following:

Code:
@interface YourViewController : UIViewController <UIAlertViewDelegate>
Then just add the following in the class you need the alert:

Code:
- (void)alertOKCancelAction {
  // open a alert with an OK and cancel button
  UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"UIAlertView" message:@"<Alert message>" delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:@"OK", nil];
  [alert show];
  [alert release];
}
and
Code:
- (void)alertView:(UIAlertView *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex {
  // the user clicked one of the OK/Cancel buttons
  if (buttonIndex == 0)
  {
    NSLog(@"ok");
  }
  else
  {
    NSLog(@"cancel");
  }
}
sohel62 is offline   Reply With Quote
 

» Advertisements
» Stats
Members: 158,862
Threads: 89,223
Posts: 380,683
Top Poster: BrianSlick (7,129)
Welcome to our newest member, higgey
Powered by vBadvanced CMPS v3.1.0

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