4 ms·
'Collections should keep track of their views' seems badly explained. You're not keeping references to views on a collection, you're keeping a reference to subv
by vmind 15y ago
'Collections should keep track of their views' seems badly explained. You're not keeping references to views on a collection, you're keeping a reference to subviews inside a view that uses a collection. The code is correct, and agnostic to whether the collection is local to the view, or a shared collection.
- prateekdayal 15y agoThanks for the feedback. I will update the post. Yes, collection should keep track of the subviews. Not the view that initializes the collection
- rgarcia 15y agoindexOfTicket and prevTicket are unused in your collection's addOne() function. </nitpick>
- prateekdayal 15y agoSorry about that. Actually they are used in the real code but I removed a lot of other stuff when I copied over. I should have deleted more carefully
- prateekdayal 15y agoActually I goofed up while typing out the post a bit. Views that contain subviews should keep a track of the sub-views. Not collections. I have updated the post. Sorry for the confusion