Git Product home page Git Product logo

Comments (2)

StatusReport avatar StatusReport commented on July 22, 2024

By using objection_initializer you define that this is the initializer that will be called when you fetch it from the injector (or factory), but you need to either provide default arguments (additional arguments to objection_initializer) or to use getObjectWithArgs: / getObject:arguments: / getObject:argumentList: and provide the arguments.

Note that the downside of fetching objects in that manner is that you lose type safety, and that you cannot provide primitive objects as arguments.

from objection.

drekka avatar drekka commented on July 22, 2024

Ahh, ok. I thought that Objection would look at the arguments and then look for matching objections in it's context.

When I was debugging through trying to see how it works, I saw Objection load the Comms singleton first. Then when it went to can the initWithComms, I could see the Comms object in the _context variable of the code that was doing the loading. So it looked like Objection could have set it into the arguments array it was passing to the load code. Presuming it could examine the init's signature and deduce what it was looking for.

As there isn't anywhere in the code where Comms is initialised (It's currently being handled by Objection) I was hoping it would be able to figure this out by itself.

Anyway. I'll have a play and see how I go. Thanks :-)

from objection.

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.