views:

57

answers:

1

Let me first say, I know how to create sections and group records within a UITableView.

What I am wanting to do is something similar to creating a photo album. So, I have all my data objects coming from core data, and, I want to be able to create a custom group, such as "My Trip to Mexico" and "First Birthday". Then, the user should be able to add objects/records into new sections/albums. So, basically the user is creating custom sections with their own custom names, and then choosing what records should go into that section/album.

So, I am just wondering what is the best way to do this? I am thinking that I would just create some extra attributes for my core data model. Or, would I create a whole new "Album Section" object, and somehow use that?

Point me in the right direction. :)

+1  A: 

I Would not recommend defining the album as an attribute within the image object, as the image could then only be part of a single album

datamodel

I would recommend the datamodel above. With this datamodel you could add images to multiple albums. I assume groups albums and sections within your description are the same.

If not you should create an additional entity and relation for different "meanings" for example: an image always has to be Part of one single Event, but can be added to multiple custom groups (like in iPhoto)

Martin Brugger
Yes! This is exactly what I was looking for. Thanks so much.
Nic Hubbard
Ok, once I have that relation set up, how do I then use it?
Nic Hubbard
This is a rather general question.I think you should have a look at or one of the apple code samples first.http://developer.apple.com/iphone/library/documentation/cocoa/conceptual/CoreData/Articles/cdRelationships.htmlorhttp://developer.apple.com/iphone/library/samplecode/iPhoneCoreDataRecipes/Introduction/Intro.html
Martin Brugger