So I have a program with "cue" objects and each have their own table cell. The thing is that the table cells have loading bars on them that represent the progress of the cues. This presents the following question: How should I structure the program?

Should the objects representing the Cues store pointers to the table cells, allowing them to update the table cells themselves, or would some other program structure work better.

Sorry if this question is too general, but I couldn't really find anything at all about this when I searched around on google and the website. I fairly new to iOS development and my programs structure is already getting chaotic. The suggestion I gave was just my initial instinct, but it's probable wrong...


Well, I don't know anything about iOs, but what you probably need is an event mechanics. Let your cue objects generate events whenever the progress changes (they should know nothing about the event receiver). Make your table or table cells event sinks for updating the loading bars (they should know nothing about who is sending those events to them). And have a third place in your program where you wire events and event sinks together.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.