logo hyperPad Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Login

    Array behaviour doesn't work properly in spawned objects

    Scheduled Pinned Locked Moved
    Fixed
    2
    3
    159
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Aidan_FireA
      Aidan_Fire
      last edited by

      iPad Air (1st)
      Latest version of iOS 12
      Latest released hyperPad as of now

      The Array behaviour, when one of its entries/values is referencing a behaviour's output from within the same object, and you spawn another object with this array setup, the spawned object's array will reference the behaviour from the original object rather than from the identical behaviour inside this spawned object.

      Here's an example project:
      https://go.aws/35htYa3
      If you look in the logic of the empty label object, you would expect that it and any spawned version of itself will display ["test","0"] to start with, and when you tap on any of them the one you tap on should switch to ["test","3"]. But instead, pressing on the spawned ones does nothing, and pressing on the original changes all of them to ["test","3"].

      1 Reply Last reply Reply Quote 0
      • HamedH
        Hamed Admin
        last edited by Hamed

        I fixed this, but theres a side effect of when you spawn an object with arrays or dictionaries, its going to have to loop through each value and update it. So potentially slower spawning object that have an array or dictionary with a lot of keys / values.

        Aidan_FireA 1 Reply Last reply Reply Quote 0
        • Aidan_FireA
          Aidan_Fire @Hamed
          last edited by Aidan_Fire

          @Hamed That makes sense anyway. Store a lot of information in an object (by default of course, probably don't want to duplicate the information if it's modified lol) and try to duplicate it, get lag. Same thing happens when you put lots of behaviours in.

          1 Reply Last reply Reply Quote 0
          • First post
            Last post