Permalink
Browse files

Sentinel changed to nsarray

  • Loading branch information...
1 parent 2de7964 commit 2e09086b86a7934461f56d27f54ff3b23a422a1a @MugunthKumar committed Mar 21, 2011
@@ -27,7 +27,6 @@ typedef void (^CancelBlock)();
onCancel:(CancelBlock) cancelled
message:(NSString*) message
cancelButtonTitle:(NSString*) cancelButtonTitle
- otherButtonTitles:(NSString*) otherButtons, va_list(others);
-
+ otherButtonTitles:(NSArray*) otherButtons;
@end
@@ -18,20 +18,24 @@ + (void) alertViewWithTitle:(NSString*) title
onCancel:(CancelBlock) cancelled
message:(NSString*) message
cancelButtonTitle:(NSString*) cancelButtonTitle
- otherButtonTitles:(NSString*) firstButton, va_list(argumentList)
+ otherButtonTitles:(NSArray*) otherButtons
{
[_cancelBlock release];
_cancelBlock = [cancelled copy];
[_dismissBlock release];
- _dismissBlock = [cancelled copy];
+ _dismissBlock = [dismissed copy];
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:title
message:message
delegate:[self class]
cancelButtonTitle:cancelButtonTitle
- otherButtonTitles:firstButton, argumentList, nil];
+ otherButtonTitles:nil];
+
+ for(NSString *buttonTitle in otherButtons)
+ [alert addButtonWithTitle:buttonTitle];
+
[alert show];
[alert release];
}
@@ -42,7 +42,7 @@ - (void)viewDidLoad
}
message:@"Hello World"
cancelButtonTitle:@"Dismiss"
- otherButtonTitles:@"First", @"Second", nil];
+ otherButtonTitles:[NSArray arrayWithObjects:@"First", @"Second", nil]];
}

0 comments on commit 2e09086

Please sign in to comment.