Skip to content

Instantly share code, notes, and snippets.

@badeen
Created August 31, 2012 00:55
Show Gist options
  • Save badeen/3546933 to your computer and use it in GitHub Desktop.
Save badeen/3546933 to your computer and use it in GitHub Desktop.
@interface CFYActivity : NSManagedObject
@property (nonatomic, strong) NSNumber * activityID;
@property (nonatomic, strong) NSNumber * type;
@property (nonatomic, strong) NSDate * date;
@property (nonatomic, strong) NSNumber * amount;
@property (nonatomic, strong) NSString * activityDescription;
@property (nonatomic, strong) NSNumber * rewardID;
@property (nonatomic, strong) CFYChain *chain;
@end
_activityEvents = [[self.chain.activities allObjects] mutableCopy];
[_activityEvents sortUsingDescriptors:@[ [NSSortDescriptor sortDescriptorWithKey:@"date" ascending:NSOrderedDescending] ]];
DebugLog(@"%@", _activityEvents);
[_activityEvents sortUsingDescriptors:@[ [NSSortDescriptor sortDescriptorWithKey:@"date" ascending:NSOrderedAscending] ]];
DebugLog(@"%@", _activityEvents);
OUTPUT
/-[CFYMerchantViewController updateMerchantInfo] (CFYMerchantViewController.m:307) (
"<CFYActivity: 0x3e1070> (entity: Activity; id: 0x3e82b0 <x-coredata://95B32AEF-C07F-45E8-9468-DBC66BBCF3DD/Activity/p1> ; data: {\n activityDescription = nil;\n activityID = 1;\n amount = 1;\n chain = \"0xc693e70 <x-coredata://95B32AEF-C07F-45E8-9468-DBC66BBCF3DD/Chain/p8>\";\n date = \"2012-08-29 23:48:14 +0000\";\n rewardID = 0;\n type = 0;\n})",
"<CFYActivity: 0x3e1680> (entity: Activity; id: 0x3e86c0 <x-coredata://95B32AEF-C07F-45E8-9468-DBC66BBCF3DD/Activity/p4> ; data: {\n activityDescription = nil;\n activityID = 4;\n amount = 1;\n chain = \"0xc693e70 <x-coredata://95B32AEF-C07F-45E8-9468-DBC66BBCF3DD/Chain/p8>\";\n date = \"2012-08-30 23:38:36 +0000\";\n rewardID = 0;\n type = 0;\n})"
)
/-[CFYMerchantViewController updateMerchantInfo] (CFYMerchantViewController.m:309) (
"<CFYActivity: 0x3e1070> (entity: Activity; id: 0x3e82b0 <x-coredata://95B32AEF-C07F-45E8-9468-DBC66BBCF3DD/Activity/p1> ; data: {\n activityDescription = nil;\n activityID = 1;\n amount = 1;\n chain = \"0xc693e70 <x-coredata://95B32AEF-C07F-45E8-9468-DBC66BBCF3DD/Chain/p8>\";\n date = \"2012-08-29 23:48:14 +0000\";\n rewardID = 0;\n type = 0;\n})",
"<CFYActivity: 0x3e1680> (entity: Activity; id: 0x3e86c0 <x-coredata://95B32AEF-C07F-45E8-9468-DBC66BBCF3DD/Activity/p4> ; data: {\n activityDescription = nil;\n activityID = 4;\n amount = 1;\n chain = \"0xc693e70 <x-coredata://95B32AEF-C07F-45E8-9468-DBC66BBCF3DD/Chain/p8>\";\n date = \"2012-08-30 23:38:36 +0000\";\n rewardID = 0;\n type = 0;\n})"
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment