Objective c 在SensibleTableView中作为CustomCell的CustomController类?
我目前使用Sensive TableView框架为新应用程序创建搜索过滤器掩码。 一切都很好,但最新的屏幕设计带来了新的问题 现在需要选择一个介于最小值和最大值之间的范围。不再使用两个数字文本字段来定义范围,我们现在必须创建一种新类型的自定义RangeSloider(对UISliderView来说很熟悉)。现在,我创建了RangeSloider(带有两个指纹的滑块)作为CustomClass,没有xib文件。我现在必须在我的tableview中作为customCell实现它? 仍然不知道如何通过STV做到这一点 我的RangeSloider需要设置一些属性:Objective c 在SensibleTableView中作为CustomCell的CustomController类?,objective-c,ios5,uitableview,frameworks,nsuserdefaults,Objective C,Ios5,Uitableview,Frameworks,Nsuserdefaults,我目前使用Sensive TableView框架为新应用程序创建搜索过滤器掩码。 一切都很好,但最新的屏幕设计带来了新的问题 现在需要选择一个介于最小值和最大值之间的范围。不再使用两个数字文本字段来定义范围,我们现在必须创建一种新类型的自定义RangeSloider(对UISliderView来说很熟悉)。现在,我创建了RangeSloider(带有两个指纹的滑块)作为CustomClass,没有xib文件。我现在必须在我的tableview中作为customCell实现它? 仍然不知道如何通过
- 浮动最小值李>
- 浮动最大值李>
- 浮动最小范围李>
- 浮点选择最小值李>
- 浮点选择最大值李>
SCUserDefaultsDefinition *userDefaultsDef = [SCUserDefaultsDefinition definitionWithDictionaryKeyNamesString:@"Search Filter:(gender,ageRangeSlider,zip,country)"];
SCPropertyDefinition *genderDef = [userDefaultsDef propertyDefinitionWithName:@"gender"];
genderDef.title = @"Gender";
genderDef.required = TRUE;
genderDef.type = SCPropertyTypeSelection;
genderDef.attributes = [SCSelectionAttributes attributesWithItems:[NSArray arrayWithObjects:@"f", @"m", nil] allowMultipleSelection:NO allowNoSelection:NO];
genderDef.autoValidate = TRUE;
/*#### CUSTOMCELL IMPLEMENTATION HERE #### */
SCPropertyDefinition *zip = [userDefaultsDef propertyDefinitionWithName:@"zip"];
zip.title = @"Zip-Code";
zip.type = SCPropertyTypeNumericTextField;
zip.attributes = [SCNumericTextFieldAttributes attributesWithMinimumValue:[NSNumber numberWithInt:01] maximumValue:[NSNumber numberWithInt:99] allowFloatValue:NO];
[self.tableViewModel generateSectionsForUserDefaultsDefinition:userDefaultsDef];
SCTableViewSection *formSection = [self.tableViewModel sectionAtIndex:0];
formSection.cellActions.valueChanged = ^(SCTableViewCell *cell, NSIndexPath *indexPath)
{
NSLog(@"\n\n*********** Key Binding Log ***********\n");
NSLog(@"Value: %@\n", [cell boundValue]);
};
如果有人能帮忙就太好了!
我真的很感激!如果你需要更多的信息,请告诉我
谢谢
拉尔斯
(我的英语很差)好的,问题解决了
解决方案来了:
要在STV中将customClass添加为CustomCell,必须使用Classname/Nibname和customControl的标记作为objectBinding定义SCCustomPropertyDefinition
SCUserDefaultsDefinition *userDefaultsDef = [SCUserDefaultsDefinition definitionWithDictionaryKeyNamesString:@"Search Filter:(gender,ageRangeSlider,zip,country)"];
SCCustomPropertyDefinition * customControl = [SCCustomPropertyDefinition definitionWithName:@"ageRangeSlider" uiElementClass:[CustomControlClass class] objectBindingsString:@"1:selectedRange;"];
[userDefaultsDef insertPropertyDefinition:customControl atIndex:1];
创建新的PropertyDefinition并将其添加到UserDefaultsDefinition后,可以使用PropertyDefinition(@“1:selectedRange;”)中的ObjectBindingString在CustomControlClass中配置响应属性。
数字表示自定义单元格中每个控件的IB标记,而字符串表示用作此控件的ResponseValue的属性
希望这可以帮助其他开发者在未来