Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/objective-c/27.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Objective c 在SensibleTableView中作为CustomCell的CustomController类?_Objective C_Ios5_Uitableview_Frameworks_Nsuserdefaults - Fatal编程技术网

Objective c 在SensibleTableView中作为CustomCell的CustomController类?

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实现它? 仍然不知道如何通过

我目前使用Sensive TableView框架为新应用程序创建搜索过滤器掩码。 一切都很好,但最新的屏幕设计带来了新的问题

现在需要选择一个介于最小值和最大值之间的范围。不再使用两个数字文本字段来定义范围,我们现在必须创建一种新类型的自定义RangeSloider(对UISliderView来说很熟悉)。现在,我创建了RangeSloider(带有两个指纹的滑块)作为CustomClass,没有xib文件。我现在必须在我的tableview中作为customCell实现它? 仍然不知道如何通过STV做到这一点

我的RangeSloider需要设置一些属性:

  • 浮动最小值
  • 浮动最大值
  • 浮动最小范围
  • 浮点选择最小值
  • 浮点选择最大值
并通过更改属性值来响应用户交互

简而言之,我的问题是: 如何将RangeSlaider类实现为CustomCell,而不使用xib文件? 和。。是否也可以跟踪我的customCell与SCUserDefaultsDefinition的用户交互

这就是我创建STV的方式:

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的属性

希望这可以帮助其他开发者在未来