Permalink
Browse files

Added data and dictionary representations

  • Loading branch information...
1 parent 2c221ad commit e286b44907084cdb7e9adba178aec81b7003211a Erica Sadun committed Oct 2, 2009
Showing with 345 additions and 83 deletions.
  1. +15 −0 ABContact.h
  2. +286 −65 ABContact.m
  3. +12 −10 ABContactsHelper.m
  4. +5 −3 ABGroup.m
  5. +27 −5 main.m
View
@@ -60,6 +60,9 @@
@property (nonatomic, readonly) NSString *contactName; // my friendly utility
@property (nonatomic, readonly) NSString *compositeName; // via AB
+#pragma mark NUMBER
+@property (nonatomic, assign) NSNumber *kind;
+
#pragma mark DATE
@property (nonatomic, assign) NSDate *birthday;
@property (nonatomic, readonly) NSDate *creationDate;
@@ -98,4 +101,16 @@
#pragma mark IMAGES
@property (nonatomic, assign) UIImage *image;
+#pragma mark REPRESENTATIONS
+
+// Conversion to dictionary
+- (NSDictionary *) baseDictionaryRepresentation; // no image
+- (NSDictionary *) dictionaryRepresentation; // image where available
+
+// Conversion to data
+- (NSData *) baseDataRepresentation; // no image
+- (NSData *) dataRepresentation; // image where available
+
++ (id) contactWithDictionary: (NSDictionary *) dict;
++ (id) contactWithData: (NSData *) data;
@end
Oops, something went wrong.

0 comments on commit e286b44

Please sign in to comment.