Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ just initialize the model with provided initializers and off you go.

User *u = [[User alloc] initWithDictionary:responseDictionary];

##How `SHModelObject` knows which value to assing to which instance variable?
## How `SHModelObject` knows which value to assing to which instance variable?

SHModelObject compares the keys of NSDictionary with the `ivar` or `property` names in an efficient way. while comparing the names of keys with ivars it doesnt take `_`, `-` or ` ` into account (also the case doesnt matter). so

Expand All @@ -77,12 +77,12 @@ you can override `- (void)serializeValue:(id)value withKey:(id)key` method if yo
}
```

##Parsing .NET JSON Dates to NSDate or NSTimeInterval
## Parsing .NET JSON Dates to NSDate or NSTimeInterval

you can use `kDateConversionOption` to convert the .NET JSON Date Strings to either `NSDate` or `NSTimeInterval` or keep it as `NSString` and parse yourself and also you can define `kInputDateFormat` to specify your input date format (JSON format, .NET Simple or .NET with timezone)


##Parsing instance variables which are also a subclass of `SHModelObject`
## Parsing instance variables which are also a subclass of `SHModelObject`

you dont have to do anything :). `SHModelObject` automatically handles it. checkout the sample code.

Expand Down Expand Up @@ -124,7 +124,7 @@ where Image object is also a `SHModelObject`
@end
```

###Parsing arrays of objects which are a subclass of `SHModelObject`
### Parsing arrays of objects which are a subclass of `SHModelObject`

similar to parsing `SHModelObject` instance variables, arrays can be handled too. you need to specify the mapping which will define that the JSON array consist of which object type.

Expand Down Expand Up @@ -181,7 +181,7 @@ MyObject *myObject = [MyObject objectWithDictionary:dictionary mapping:mappingDi

```

##SHRealmObject
## SHRealmObject

[Realm](http://realm.io/) support out of the box. `SHRealmObject` is a sublclass of `RLMObject` from Realm. If you want to use both SHModelObject to parse your JSON responses and have RLMObject to be used with Realm database. `SHRealmObject` is they class you need.

Expand Down Expand Up @@ -230,7 +230,7 @@ RLMRealm *realm = [RLMRealm defaultRealm];
```


##How to Use it.
## How to Use it.

1- add the files

Expand All @@ -252,15 +252,15 @@ RLMRealm *realm = [RLMRealm defaultRealm];

5- thats it. off you go.

##Tasks Pending
## Tasks Pending

- [X] adding to cocoapods.
- [X] adding support for custom instance variable types that are also subclasses of `SHModelObject`
- [X] implementing `NSCoding` for archiving/unarchiving the model objects.
- [X] adding support for handling arrays of custom `SHModelObject` objects.
- [ ] implementing a deserializer for converting the object to NSDictionary.

##Contact Me
## Contact Me

Shan Ul Haq (http://grevolution.me)

Expand All @@ -270,6 +270,6 @@ Shan Ul Haq (http://grevolution.me)

- http://sg.linkedin.com/in/grevolution/

##License
## License

`SHModelObject` is available under the MIT license. See the LICENSE file for more info.