diff options
author | Grant Paul <chpwn@chpwn.com> | 2010-08-09 22:34:46 +0000 |
---|---|---|
committer | Jay Freeman (saurik) <saurik@saurik.com> | 2010-09-30 08:21:04 +0000 |
commit | 38be2c4b5f4a0183977f113365f0fb4634a88066 (patch) | |
tree | 96aba05b2a59f10751495dad489b387692f35c7a | |
parent | c5dd0c7fc62882c14ecc626428e9d4ab79d0cf07 (diff) |
Merged uialertview-for-cyactionsheet.patch from chpwn.
-rw-r--r-- | Cydia.mm | 11 |
1 files changed, 7 insertions, 4 deletions
@@ -281,7 +281,7 @@ static _finline NSString *CydiaURL(NSString *path) { @end /* }}} */ -@interface CYActionSheet : UIActionSheet { +@interface CYActionSheet : UIAlertView { unsigned button_; } @@ -291,12 +291,15 @@ static _finline NSString *CydiaURL(NSString *path) { @implementation CYActionSheet - (id) initWithTitle:(NSString *)title buttons:(NSArray *)buttons defaultButtonIndex:(int)index { - if ((self = [super initWithTitle:title buttons:buttons defaultButtonIndex:index delegate:self context:nil]) != nil) { + if ((self = [super init])) { + [self setDelegate:self]; + for (NSString *button in buttons) [self addButtonWithTitle:button]; + [self setCancelButtonIndex:index]; } return self; } -- (void) alertSheet:(UIActionSheet *)sheet buttonClicked:(int)button { - button_ = button; +- (void) alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex { + button_ = buttonIndex + 1; } - (int) yieldToPopupAlertAnimated:(BOOL)animated { |