Using a UIPickerView to make a CoreData Relationship
Posted
by DVG
on Stack Overflow
See other posts from Stack Overflow
or by DVG
Published on 2010-05-31T16:22:45Z
Indexed on
2010/05/31
16:22 UTC
Read the original article
Hit count: 395
Okay, so I have a fairly simple application set up.
I have two different CoreData Entities, Games and Platforms, each have one attribute: name, and they have a one-to-many relationship between them.
Platforms are populated on the first launch of the application, and will never change as a result of user input.
I'm working on my Add view to let the user add new games to their personal database, and each game should select from a platform. The add view itself is a grouped table view with static custom cells. Tapping the platform cell should advance the user to another view to select the platform.
My thought is that UIPickerView seems like a logical choice for the control, since the Platform list is static, but I'm not sure how to use it with CoreData. Even if I construct a fetch request to get the Platform objects and extract the strings out, how do I go about linking the new Game object to the original Platform object?
© Stack Overflow or respective owner