Skip to content
This repository has been archived by the owner on Sep 5, 2023. It is now read-only.

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
vilanovi committed Mar 11, 2015
1 parent 3fc1206 commit 364f9ab
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,19 @@ For example, we could create a new managed object for the corresponding class, p
return nil;
}
```
####3. Enable equality check

In order to avoid unnecessary "hasChanges" flags in our managed objects, override the method `-mts_checkValueEqualityBeforeAssignmentForKey:` and return `YES` in order to make Motis check equality before assigning a value via KVC. This way, if a new value is equal (via the `isEqual:` method) to the current already set value, Motis will not make the assigniment.

```objective-c
- (BOOL)mts_checkValueEqualityBeforeAssignmentForKey:(NSString*)key
{
// Return YES to make Motis check for equality before making an assignment via KVC.
// Return NO to make Motis always assign a value via KVC without checking for equality before.

return YES;
}
```
### Automatic Validation
The following table indicates the supported validations in the current Motis version:

Expand Down

0 comments on commit 364f9ab

Please sign in to comment.