diff --git a/Ample/Slot.h b/Ample/Slot.h index 7e94492..f26789f 100644 --- a/Ample/Slot.h +++ b/Ample/Slot.h @@ -42,7 +42,7 @@ typedef enum SlotType { -(void)reset; -(void)prepareView: (SlotTableCellView *)view; --(void)selectValue: (NSString *)value; +-(BOOL)selectValue: (NSString *)value; -(Media)selectedMedia; diff --git a/Ample/Slot.m b/Ample/Slot.m index f503001..c590f7c 100644 --- a/Ample/Slot.m +++ b/Ample/Slot.m @@ -96,18 +96,19 @@ static NSDictionary *TypeMap = nil; } } --(void)selectValue: (NSString *)value { +-(BOOL)selectValue: (NSString *)value { if (value) { NSInteger index = 0; for (SlotOption *item in _options) { if ([[item value] isEqualToString: value]) { [self setSelectedIndex: index]; - return; + return YES; } ++index; } } + return NO; //[self setSelectedIndex: _defaultIndex >= 0 ? _defaultIndex : 0]; }