// Alert sheet attached to bootom of Screen. General/UIAlertSheet *alertSheet = General/[[UIAlertSheet alloc] initWithFrame:General/CGRectMake(0, 240, 320, 240)]; [alertSheet setTitle:@”Alert Title”]; [alertSheet setBodyText:@”This is an alert.”]; [alertSheet addButtonWithTitle:@”Yes”]; [alertSheet addButtonWithTitle:@”No”]; [alertSheet setDelegate:self]; [alertSheet presentSheetFromAboveView:self];
// Allert sheet displayed at centre of screen. General/NSArray *buttons = General/[NSArray arrayWithObjects:@”OK”, @”Cancel”, nil]; General/UIAlertSheet *alertSheet = General/[[UIAlertSheet alloc] initWithTitle:@”An Alert” buttons:buttons defaultButtonIndex:1 delegate:self context:self]; [alertSheet setBodyText:@”Do something?”]; [alertSheet popupAlertAnimated:YES];
- (void)setTitle:(General/NSString*)title;
- (void)setBodyText:(General/NSString*)text;
- (void)addButtonWithTitle:(General/NSString*)title;
Numbered, starting with one. Number is returned in delegate callback.
- (void)setDelegate:(id)delegate;
- (void)presentSheetFromAboveView:(General/UIView*)view;
- (void)popupAlertAnimated:(BOOL)animated;
- (void)popupAlertAnimated:(BOOL)animated: atOffsett:(float)offset;
- (void)dismiss;
Same as dismissAnimated:YES, I think.
- (void)dismissAnimated:(BOOL)animated;
General/UIAlertSheet delegate methods
- (void)alertSheet:(General/UIAlertSheet*)sheet buttonClicked:(int)button;
(void)alertSheet:(General/UIAlertSheet*)sheet buttonClicked:(int)button { if ( button == 1 ) General/NSLog(@”Yes”); else if ( button == 2 ) General/NSLog(@”No”);
[sheet dismiss]; }