I have some encrypted NSString store in a transformable field. I need to decrypt and list all value in alphabetical order.
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];
It seems the block doesn’t performance. Could you give me any hints? Thanks!
On iOS and on OS X prior to 10.6 and when using SQLite-based stores, block predicates are not supported.