mirror of https://github.com/ksherlock/ample.git
Slot selectValue - return BOOL to indicate if selected.
This commit is contained in:
parent
b728ae7f49
commit
5227868b79
|
@ -42,7 +42,7 @@ typedef enum SlotType {
|
|||
-(void)reset;
|
||||
-(void)prepareView: (SlotTableCellView *)view;
|
||||
|
||||
-(void)selectValue: (NSString *)value;
|
||||
-(BOOL)selectValue: (NSString *)value;
|
||||
|
||||
-(Media)selectedMedia;
|
||||
|
||||
|
|
|
@ -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];
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue