Giter Site home page Giter Site logo

Comments (7)

krzysztofzablocki avatar krzysztofzablocki commented on June 5, 2024

what if you return NSNull ?

from propertymapper.

fonkadelic avatar fonkadelic commented on June 5, 2024

An exception is thrown:
Invalid condition not satisfying: isSameTypeObject'

from propertymapper.

krzysztofzablocki avatar krzysztofzablocki commented on June 5, 2024

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.

fonkadelic avatar fonkadelic commented on June 5, 2024

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.

krzysztofzablocki avatar krzysztofzablocki commented on June 5, 2024

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.

fonkadelic avatar fonkadelic commented on June 5, 2024

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.

krzysztofzablocki avatar krzysztofzablocki commented on June 5, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.