I'm trying to sort an RLMArray using its property but I am getting the error:
This method may only be called on RLMArray instances retrieved from an RLMRealm`
RLMResults *rlmResults = [myLog.myRLMArray sortedResultsUsingProperty:@"orderNum" ascending:YES];
Here myLog.myRLMArray
is a copy of data I get from the RLMRealm
.
and myLog
is declared as:
RLM_ARRAY_TYPE(MyWidgetSet)
@interface MYLogObject : RLMObject
@property RLMArray< MyWidgetSet *>< MyWidgetSet > *myRLMArray;
@end
and my custom class is
#import <Realm/Realm.h>
@interface MyWidgetSet : RLMObject
@property NSString *widgetName;
@property NSString *orderNum;
@end
I found a similar question which was posted 2 years ago. I am hoping for an updated solution for this issue.I'm using Realm 2.1.2