Permalink
Browse files

Merge pull request #3 from gfontenot/master

addButtonItem method
  • Loading branch information...
2 parents b861bbb + 89da31c commit b64b4dd4cc0c717ddb3cc0becc1bde73265f61e9 @jivadevoe committed May 28, 2011
Showing with 22 additions and 0 deletions.
  1. +2 −0 UIActionSheet+Blocks.h
  2. +9 −0 UIActionSheet+Blocks.m
  3. +2 −0 UIAlertView+Blocks.h
  4. +9 −0 UIAlertView+Blocks.m
View
@@ -13,4 +13,6 @@
-(id)initWithTitle:(NSString *)inTitle cancelButtonItem:(RIButtonItem *)inCancelButtonItem destructiveButtonItem:(RIButtonItem *)inDestructiveItem otherButtonItems:(RIButtonItem *)inOtherButtonItems, ... NS_REQUIRES_NIL_TERMINATION;
+- (void)addButtonItem:(RIButtonItem *)item;
+
@end
View
@@ -57,6 +57,15 @@ -(id)initWithTitle:(NSString *)inTitle cancelButtonItem:(RIButtonItem *)inCancel
return self;
}
+- (void)addButtonItem:(RIButtonItem *)item
+{
+ NSMutableArray *buttonsArray = objc_getAssociatedObject(self, RI_BUTTON_ASS_KEY);
+
+ [self addButtonWithTitle:item.label];
+ [buttonsArray addObject:item];
+
+}
+
- (void)actionSheet:(UIActionSheet *)actionSheet didDismissWithButtonIndex:(NSInteger)buttonIndex
{
NSArray *buttonsArray = objc_getAssociatedObject(self, RI_BUTTON_ASS_KEY);
View
@@ -13,4 +13,6 @@
-(id)initWithTitle:(NSString *)inTitle message:(NSString *)inMessage cancelButtonItem:(RIButtonItem *)inCancelButtonItem otherButtonItems:(RIButtonItem *)inOtherButtonItems, ... NS_REQUIRES_NIL_TERMINATION;
+- (void)addButtonItem:(RIButtonItem *)item;
+
@end
View
@@ -48,6 +48,15 @@ -(id)initWithTitle:(NSString *)inTitle message:(NSString *)inMessage cancelButto
return self;
}
+- (void)addButtonItem:(RIButtonItem *)item
+{
+ NSMutableArray *buttonsArray = objc_getAssociatedObject(self, RI_BUTTON_ASS_KEY);
+
+ [self addButtonWithTitle:item.label];
+ [buttonsArray addObject:item];
+
+}
+
- (void)alertView:(UIAlertView *)alertView didDismissWithButtonIndex:(NSInteger)buttonIndex
{
NSArray *buttonsArray = objc_getAssociatedObject(self, RI_BUTTON_ASS_KEY);

0 comments on commit b64b4dd

Please sign in to comment.