You can get it by key, as per https://forums.coronalabs.com/topic/42759-how-do-you-access-display-objects-in-a-display-group-using-the-display-objects-variable-name/
But is there also a way to get it by ID from the parent or ultimate parent (e.g. self.view)? You’d optimally want to set and get using a string or number property (as long as it doesn’t turn into an iteration behind the scenes…) Something like myView viewWithTag:myTag] in Objective-C.
That is, by reference (not having to loop through all display objects on the screen…)
Display objects are key-value tables, so you could add any custom key as property. But this won’t help since you would have to iterate and match on the property value.
The normal solution is to keep track of them in an external table. Even going by reference here will ultimately end up in some sort of iteration, but hopefully a low-level one that is efficient(?)
So I guess what I’m looking for the same table used by display.* for garbage collection or similar? As long as it will let me set the key for the display object in that table, and not just get it. Or one like it, introduced in Corona.