gpt4 book ai didi

objective-c - 核心数据 : Sorting & Decrypting Value from a Transformable Field

转载 作者:行者123 更新时间:2023-11-29 04:35:04 25 4
gpt4 key购买 nike

我在可转换字段中有一些加密的 NSString 存储。我需要解密并按字母顺序列出所有值。

NSSortDescriptor *sortDescriptor = [[NSSortDescriptor alloc] 
initWithKey:@"trans_word"
ascending:YES
comparator:^NSComparisonResult(id obj1, id obj2) {
NSString* s1 = [encryptObj decryptingfromValue:obj1];
NSString* s2 = [encryptObj decryptingfromValue:obj2];
NSLog(@"xxx");
return [s1 compare:s2];
}];
NSArray *sortDescriptors = [NSArray arrayWithObjects:sortDescriptor, nil];
[fetchRequest setSortDescriptors:sortDescriptors];

该 block 似乎没有性能。你能给我任何提示吗?谢谢!

最佳答案

在 iOS 和 10.6 之前的 OS X 上以及使用基于 SQLite 的存储时,不支持 block 谓词。

Special Considerations

In Mac OS X v10.6, Core Data supports this method in the in-memory and atomic stores, but not in the SQLite-based store. (Link)

关于objective-c - 核心数据 : Sorting & Decrypting Value from a Transformable Field,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11174480/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com