Permalink
Browse files

Success has two c's.

  • Loading branch information...
1 parent b490c20 commit 8d673a4e462470625fbd2e8fffec9b9423b9a23f @typeoneerror typeoneerror committed Dec 28, 2011
@@ -43,7 +43,7 @@
- (void)showActionSheetPicker;
// For subclasses. This is used to send a message to the target upon a successful selection and dismissal of the picker (i.e. not canceled).
-- (void)notifyTarget:(id)target didSucceedWithAction:(SEL)sucessAction origin:(id)origin;
+- (void)notifyTarget:(id)target didSucceedWithAction:(SEL)successAction origin:(id)origin;
// For subclasses. This is an optional message upon cancelation of the picker.
- (void)notifyTarget:(id)target didCancelWithAction:(SEL)cancelAction origin:(id)origin;
@@ -119,7 +119,7 @@ - (UIView *)configuredPickerView {
return nil;
}
-- (void)notifyTarget:(id)target didSucceedWithAction:(SEL)sucessAction origin:(id)origin {
+- (void)notifyTarget:(id)target didSucceedWithAction:(SEL)successAction origin:(id)origin {
NSAssert(NO, @"This is an abstract class, you must use a subclass of AbstractActionSheetPicker (like ActionSheetStringPicker)");
}
@@ -38,10 +38,10 @@ typedef void(^ActionStringCancelBlock)(ActionSheetStringPicker *picker);
"rows" is an array of strings to use for the picker's available selection choices.
"initialSelection" is used to establish the initially selected row;
*/
-+ (id)showPickerWithTitle:(NSString *)title rows:(NSArray *)data initialSelection:(NSInteger)index target:(id)target sucessAction:(SEL)sucessAction cancelAction:(SEL)cancelActionOrNil origin:(id)origin;
++ (id)showPickerWithTitle:(NSString *)title rows:(NSArray *)data initialSelection:(NSInteger)index target:(id)target successAction:(SEL)successAction cancelAction:(SEL)cancelActionOrNil origin:(id)origin;
// Create an action sheet picker, but don't display until a subsequent call to "showActionPicker". Receiver must release the picker when ready. */
-- (id)initWithTitle:(NSString *)title rows:(NSArray *)data initialSelection:(NSInteger)index target:(id)target sucessAction:(SEL)sucessAction cancelAction:(SEL)cancelActionOrNil origin:(id)origin;
+- (id)initWithTitle:(NSString *)title rows:(NSArray *)data initialSelection:(NSInteger)index target:(id)target successAction:(SEL)successAction cancelAction:(SEL)cancelActionOrNil origin:(id)origin;
@@ -45,22 +45,22 @@ + (id)showPickerWithTitle:(NSString *)title rows:(NSArray *)strings initialSelec
}
- (id)initWithTitle:(NSString *)title rows:(NSArray *)strings initialSelection:(NSInteger)index doneBlock:(ActionStringDoneBlock)doneBlock cancelBlock:(ActionStringCancelBlock)cancelBlockOrNil origin:(id)origin {
- self = [self initWithTitle:title rows:strings initialSelection:index target:nil sucessAction:nil cancelAction:nil origin:origin];
+ self = [self initWithTitle:title rows:strings initialSelection:index target:nil successAction:nil cancelAction:nil origin:origin];
if (self) {
self.onActionSheetDone = doneBlock;
self.onActionSheetCancel = cancelBlockOrNil;
}
return self;
}
-+ (id)showPickerWithTitle:(NSString *)title rows:(NSArray *)data initialSelection:(NSInteger)index target:(id)target sucessAction:(SEL)sucessAction cancelAction:(SEL)cancelActionOrNil origin:(id)origin {
- ActionSheetStringPicker *picker = [[[ActionSheetStringPicker alloc] initWithTitle:title rows:data initialSelection:index target:target sucessAction:sucessAction cancelAction:cancelActionOrNil origin:origin] autorelease];
++ (id)showPickerWithTitle:(NSString *)title rows:(NSArray *)data initialSelection:(NSInteger)index target:(id)target successAction:(SEL)successAction cancelAction:(SEL)cancelActionOrNil origin:(id)origin {
+ ActionSheetStringPicker *picker = [[[ActionSheetStringPicker alloc] initWithTitle:title rows:data initialSelection:index target:target successAction:successAction cancelAction:cancelActionOrNil origin:origin] autorelease];
[picker showActionSheetPicker];
return picker;
}
-- (id)initWithTitle:(NSString *)title rows:(NSArray *)data initialSelection:(NSInteger)index target:(id)target sucessAction:(SEL)sucessAction cancelAction:(SEL)cancelActionOrNil origin:(id)origin {
- self = [self initWithTarget:target successAction:sucessAction cancelAction:cancelActionOrNil origin:origin];
+- (id)initWithTitle:(NSString *)title rows:(NSArray *)data initialSelection:(NSInteger)index target:(id)target successAction:(SEL)successAction cancelAction:(SEL)cancelActionOrNil origin:(id)origin {
+ self = [self initWithTarget:target successAction:successAction cancelAction:cancelActionOrNil origin:origin];
if (self) {
self.data = data;
self.selectedIndex = index;
@@ -94,16 +94,16 @@ - (UIView *)configuredPickerView {
return stringPicker;
}
-- (void)notifyTarget:(id)target didSucceedWithAction:(SEL)sucessAction origin:(id)origin {
+- (void)notifyTarget:(id)target didSucceedWithAction:(SEL)successAction origin:(id)origin {
if (self.onActionSheetDone) {
_onActionSheetDone(self, self.selectedIndex, [self.data objectAtIndex:self.selectedIndex]);
return;
}
- else if (target && [target respondsToSelector:sucessAction]) {
- [target performSelector:sucessAction withObject:[NSNumber numberWithInt:self.selectedIndex] withObject:origin];
+ else if (target && [target respondsToSelector:successAction]) {
+ [target performSelector:successAction withObject:[NSNumber numberWithInt:self.selectedIndex] withObject:origin];
return;
}
- NSLog(@"Invalid target/action ( %s / %s ) combination used for ActionSheetPicker", object_getClassName(target), (char *)sucessAction);
+ NSLog(@"Invalid target/action ( %s / %s ) combination used for ActionSheetPicker", object_getClassName(target), (char *)successAction);
}
- (void)notifyTarget:(id)target didCancelWithAction:(SEL)cancelAction origin:(id)origin {
@@ -91,10 +91,10 @@ - (IBAction)selectABlock:(UIControl *)sender {
}
- (IBAction)selectAnAnimal:(UIControl *)sender {
- [ActionSheetStringPicker showPickerWithTitle:@"Select Animal" rows:self.animals initialSelection:self.selectedIndex target:self sucessAction:@selector(animalWasSelected:element:) cancelAction:@selector(actionPickerCancelled:) origin:sender];
+ [ActionSheetStringPicker showPickerWithTitle:@"Select Animal" rows:self.animals initialSelection:self.selectedIndex target:self successAction:@selector(animalWasSelected:element:) cancelAction:@selector(actionPickerCancelled:) origin:sender];
/* Example ActionSheetPicker using customButtons
- self.actionSheetPicker = [[ActionSheetPicker alloc] initWithTitle@"Select Animal" rows:self.animals initialSelection:self.selectedIndex target:self sucessAction:@selector(itemWasSelected:element:) cancelAction:@selector(actionPickerCancelled:) origin:sender
+ self.actionSheetPicker = [[ActionSheetPicker alloc] initWithTitle@"Select Animal" rows:self.animals initialSelection:self.selectedIndex target:self successAction:@selector(itemWasSelected:element:) cancelAction:@selector(actionPickerCancelled:) origin:sender
[self.actionSheetPicker addCustomButtonWithTitle:@"Special" value:[NSNumber numberWithInt:1]];
self.actionSheetPicker.hideCancel = YES;

0 comments on commit 8d673a4

Please sign in to comment.