0

次のような userResults というクラスがあります。

#import <Foundation/Foundation.h>

@interface userResults : NSObject

@property (nonatomic, strong) NSString *resultsMix;
@property (nonatomic, strong) NSNumber *resultsSaving;
@property (nonatomic, strong) NSNumber *resultsBlendComponent1;
@property (nonatomic, strong) NSNumber *resultsBlendComponent2;
@property (nonatomic, strong) NSNumber *resultsTotalProtein;
@property (nonatomic, strong) NSNumber *resultsPricePerPound;
@property (nonatomic, strong) NSNumber *resultsPricePerPoint;

@end

このような実装では:

#import "userResults.h"

@implementation userResults

@end

結果と呼ばれる NSMutableArray で、これの複数の値を構築します。

*resultsSaving フィールドで結果のレコードを並べ替えられるようにしたいと考えています。

results1 と results2 の 2 つの配列に値を設定し、それらをより大きな配列に貼り付けてから、このコードで並べ替えを試みます。

results = [NSMutableArray arrayWithObjects:results1,results2,nil];
NSSortDescriptor *sort = [NSSortDescriptor sortDescriptorWithKey:@"resultsSaving" ascending:YES];
[results sortUsingDescriptors:sort];

うまくいきません。私はいくつかの概念的な問題を抱えている可能性があると思います。どんな助けでも大歓迎です。

ブライアン

4

1 に答える 1