私はNSDictionaryのNSArrayを持っています。すべての辞書にはimage-path
というキーがあります。
キーimage-path
の特定の値(変数path
の内容)に一致する辞書のみのフィルタリングされた配列を取得したいとします。NSPredicateが 'Unknown number typeまたはnilを算術関数式に渡しました。' QuickLookプラグインで
私はこのラインを使用しているデータの構造(それがキー画像パスのために私の辞書のすべての値を出力します)検証:
:私はこのコードを使用していますNSLog(@"array key paths: %@", [mountedImages valueForKeyPath:@"image-path"]);
を
NSString *path = @"value-I-want-to-match";
NSPredicate *predicate = [NSPredicate predicateWithFormat:@"(image-path LIKE[cd] \"%@\")", path];
NSArray *filteredArray = nil;
filteredArray = [mountedImages filteredArrayUsingPredicate:predicate];
は、最後の行はクラッシュし、次のエラー生成:
[ERROR] Computing 6571367.19831142 raised 'Unknown number type or nil passed to arithmetic function expression.'
私はこれをやっているのQuickLookプラグイン。 gdbでコードをステップ実行することはできますが、トレースを取得することはできません。
[...]
[ERROR] Computing 6571367.19831142 raised 'Unknown number type or nil passed to arithmetic function expression.'
[Switching to process 23335 thread 0x8903]
[Switching to process 23335 thread 0xa703]
[Switching to process 23335 thread 0x8903]
Program ended with exit code: 0