Comments (7)
what if you return NSNull ?
from propertymapper.
An exception is thrown:
Invalid condition not satisfying: isSameTypeObject'
from propertymapper.
hmm, can you comment out the type checking just to see if NSNull works to nil out the variable without it ? I don't remember if that should work or not in KVC, can't test this moment.
If it works then we can make an exception for NSNull type for pointer properties
from propertymapper.
After disabling type checking there is an NSInvalidArgumentException: Unacceptable type of value for attribute: property = "dayOfBirth"; desired type = NSDate; given type = NSNull; value = <null>.
I'm pretty sure this happens only because i'm using a NSManagedObject
. For a regular NSObject
the mapping probably works.
from propertymapper.
ok, I think we can give NSNull special meaning for boxing, since I doubt we have other use case for it than marking something as failed, so in recap:
- Allow NSNull to pass type validation for object properties
- Unwrap NSNull into nil before setValue forKeyPath
I'll have some time over this weekend to implement it, if you are in a hurry I always like PR's :)
I'll probably do it with support for NSError as well, so we can fail validation if a KZCall/Boxing is considered invalid as described in #53
Any thoughts?
from propertymapper.
Are you already working on this? If not, i can try to come up with a PR with the 2 points you mentioned in the next days.
from propertymapper.
Go ahead as I'll be in London for next couple of days
On Wed, Nov 25, 2015 at 8:09 PM, Bernhard Loibl [email protected]
wrote:
Are you already working on this? If not, i can try to come up with a PR with the 2 points you mentioned in the next days.
Reply to this email directly or view it on GitHub:
#54 (comment)
from propertymapper.
Related Issues (20)
- Assertion failure - which property? HOT 5
- Update CocoaPods with the latest commit HOT 2
- Asserts when receiving an NSArray instead of an NSDictionary HOT 3
- No testing of validation errors in KZPropertyMapperValidatorTests.m HOT 5
- Crash when creating the date formatter
- Support for Swift HOT 1
- CocoaPods and 2.5.1? HOT 1
- KZCall on different object? HOT 4
- Doesn't work when there's a getter method defined HOT 2
- Support for compound property? HOT 4
- Support for NSEntityDescription instance HOT 2
- Nullify value for missing key/default value HOT 1
- ISO 8601 date format HOT 1
- Ability to Propagate Errors when using Custom Boxing / Call HOT 3
- Suppressing error messages HOT 4
- Crash when converting from number to NSDate HOT 2
- Crash when mapping null object to a primitive HOT 1
- validationErrors array is always null HOT 2
- Better warning message for missing Box custom methods HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from propertymapper.