Skip to content
Browse files

Add static objectFromDictionary

  • Loading branch information...
1 parent 0e33e83 commit 5744e9545c99759e0c9973729b50cdd3453afba9 @yosit committed Mar 18, 2012
Showing with 6 additions and 0 deletions.
  1. +1 −0 Jastor/Jastor/Jastor.h
  2. +5 −0 Jastor/Jastor/Jastor.m
View
1 Jastor/Jastor/Jastor.h
@@ -9,6 +9,7 @@
@interface Jastor : NSObject <NSCoding>
@property (nonatomic, retain) NSString *objectId;
++ (id)objectFromDictionary:(NSDictionary*)dictionary;
- (id)initWithDictionary:(NSDictionary *)dictionary;
View
5 Jastor/Jastor/Jastor.m
@@ -10,6 +10,11 @@ @implementation Jastor
Class nsDictionaryClass;
Class nsArrayClass;
++ (id)objectFromDictionary:(NSDictionary*)dictionary {
+ id item = [[[self alloc] initWithDictionary:dictionary] autorelease];
+ return item;
+}
+
- (id)initWithDictionary:(NSDictionary *)dictionary {
if (!nsDictionaryClass) nsDictionaryClass = [NSDictionary class];
if (!nsArrayClass) nsArrayClass = [NSArray class];

0 comments on commit 5744e95

Please sign in to comment.
Something went wrong with that request. Please try again.