Skip to content

Instantly share code, notes, and snippets.

View weejayuk's full-sized avatar

Will Johnston weejayuk

  • Control Strategies
  • Alfriston, UK
View GitHub Profile
@weejayuk
weejayuk / A very short test
Created August 5, 2011 10:19
NSDate Extension to create .net JSON date strings and convert back. Testing for this was very limited, so use with caution. Some of the code was taken from here. http://www.pittle.org/weblog/how-to-convert-datetime-net-object-serialized-as-json-by-wcf-to-
NSDate *timenow=[NSDate date];
NSLog(@"Date before date2dot net=%@",[timenow description]);
NSString *date2DotNet=[timenow dateToDotNet];
NSLog(@"Dot net version of now = %@",date2DotNet);
timenow=[NSDate dateFromDotNet:date2DotNet];
NSLog(@"Date back from date2dot net=%@",[timenow description]);
typedef BOOL (^BlockingRelationship)(id,NSString*);
@interface NSManagedObject (ExtendedManagedObject)
- (NSDictionary*) toDictionaryBlockingRelationships:(BOOL (^)(id obj,NSString *relationship))blockRelationship;
+ (NSManagedObject*) createManagedObjectFromDictionary:(NSDictionary*)dict
inContext:(NSManagedObjectContext*)context;
@end