Welcome, Guest
Username Password: Remember me

A many to many relationship
(1 viewing) (1) Guest
  • Page:
  • 1

TOPIC: A many to many relationship

A many to many relationship 1 year, 4 months ago #1

In a another core data project I have an entity Sheet with a many to many relationship with an entity Tag . In the RootViewController I display the tags by the name property. When I select a tag cell I'd like to push a view controller listing Sheets with that tag. After looking at the core data sample project and liking the

+ (id)sectionWithHeaderTitle:(NSString *)sectionHeaderTitle
withEntityClassDefinition:(SCClassDefinition *)classDefinition
usingPredicate:(NSPredicate *)predicate

method, I'm not sure how to accomplish this with SCT. How would you handle this?

Gary
  • panamind
  • OFFLINE
  • Senior Boarder
  • Posts: 77
  • Karma: 4

Re: A many to many relationship 1 year, 4 months ago #2

Hi Gary,

If I understand you correctly, your case is almost identical to that of the "Core Data App" sample application, under the "People" tab. If you select a person, a detail view of all the tasks associated with this person is displayed. We've disabled "task" editing in the sample application from the class definition, but you can easily remove that if you wish.
  • tarekskr
  • OFFLINE
  • Administrator
  • Posts: 2404
  • Karma: 72

Re: A many to many relationship 1 year, 4 months ago #3

tarekskr wrote:


If I understand you correctly, your case is almost identical to that of the "Core Data App" sample application, under the "People" tab. If you select a person, a detail view of all the tasks associated with this person is displayed. We've disabled "task" editing in the sample application from the class definition, but you can easily remove that if you wish.



Not quite. Selecting a person displays a detail view of the person. You have to select 'tasks' in this view to view the tasks associated with the person. In my situation, I'd like to go directly to viewing the tasks when you select a person.
  • panamind
  • OFFLINE
  • Senior Boarder
  • Posts: 77
  • Karma: 4

Re: A many to many relationship 1 year, 4 months ago #4

You'll be able to do exactly that in our final STV 2.0 release. In the final release, if STV detects that your entity class definition has only one relationship (no other attributes), it will automatically jump to the details of this relationship and will not generate an intermediate cell for it (as it currently does). This behavior will also be customizable.

I'll keep you posted.
  • tarekskr
  • OFFLINE
  • Administrator
  • Posts: 2404
  • Karma: 72
  • Page:
  • 1
Time to create page: 1.32 seconds