Kodeco Forums

Video Tutorial: Collection Views Part 4: Inserting Cells

In this video tutorial, you'll learn how to insert new cells into the collection view.


This is a companion discussion topic for the original entry at https://www.raywenderlich.com/2009-video-tutorial-collection-views-part-4-inserting-cells

First, thanks for putting this site and this tutorial together. I am learning slowly, but surely how to build apps. Secondly, I have used this tutorial for the base of my new app, but I have a data model with some hierarchy. I create a default set of objects, houses and rooms for example, where a house has many rooms, and they display nicely when I start the app. If I click on a house, I get a bunch of room cells in my collection view. But when I add a new room to a house, it is renaming the all of the rooms to the name of the new room. I am currently hard coding the room name, but why is it overriding all of the room.names in my data model. At first I thought it was just a label problem, but when I do a query on the data, indeed all of the room.name attributes have changed. Can you point me to a tutorial that uses a data model to drive the CollectionView? Thanks again…

Hey @mwd1973,

If I remember correctly, this series does use a data source to drive the cells. It’s just that it’s a static one, rather than using something like Core Data.

I’m afraid we don’t have any tutorials on the site that demonstrate how to use a collection view with a dynamic data source, and it’s a little difficult to try and diagnose your issue without seeing your code.

Perhaps you could post just the class than handles the creation of new cells and inserting the underlying data into your store and I’ll see if I can spot any potential causes?

Thank you for the reply. I solved the problem by using the unwind “pattern”. You can tell I am a rookie! Anyhow, when ever I added an object to my data model, I add it there…