Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/objective-c/25.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 使用天花板功能预测_Objective C_Ios_Cocoa_Nspredicate - Fatal编程技术网

Objective c 使用天花板功能预测

Objective c 使用天花板功能预测,objective-c,ios,cocoa,nspredicate,Objective C,Ios,Cocoa,Nspredicate,我正在尝试为NSPredicate使用天花板功能。到目前为止,以下是我的代码片段: self.filterPredicateTemplate = [NSPredicate predicateWithFormat:@"ceiling(($_NOW_INTERVAL - dateupload) / 3600) == $_INTERVAL"]; - (NSDictionary *)dictionaryForPredicateTemplate:(id)value { NSNumber *

我正在尝试为NSPredicate使用天花板功能。到目前为止,以下是我的代码片段:

self.filterPredicateTemplate = [NSPredicate predicateWithFormat:@"ceiling(($_NOW_INTERVAL - dateupload) / 3600) == $_INTERVAL"];

- (NSDictionary *)dictionaryForPredicateTemplate:(id)value {
       NSNumber *interval = [NSNumber numberWithDouble:[[NSDate date] timeIntervalSince1970]];
   return [NSDictionary dictionaryWithObjectsAndKeys:value, @"_INTERVAL", interval, @"_NOW_INTERVAL", nil]; 
}

NSPredicate *predicate = [self.filterPredicateTemplate predicateWithSubstitutionVariables:[self dictionaryForPredicateTemplate:key]];
NSArray *a = [self.list filteredArrayUsingPredicate:predicate];
最后一行抛出此错误:

“NSInvalidArgumentException”,原因:“-[NSCFString objCType]: 已将无法识别的选择器发送到实例0x4e1f060'


我不知道该错误,正在这里寻求帮助。

请显示dateupload方法的定义。听起来要么值不是您期望的值,要么在调用filteredArrayUsingPredicate之前释放了其中一个值。@DaveDeLong dateupload是NSDictionary对象的一部分,它是一个数值。