-1

Im very newbie to iOS programming.

I have core data app for tasks with two entities: Group and Task.

User creates task groups like Work, Home, Shoping and tasks related to these groups like for Work-Deploy an app, for Shopping-buy milk etc.

I have two view controllers.

Problem is that now when user clicks on a Group in tableView, it gets to next viewController, where tasks from all groups are listed. So, how I could show only Group (selected in tableView) related Tasks?

For now when for exapmle I click on Work group I see Deploy an app and Buy milk etc tasks.. I guess its something wrong with NSFetchRequest or NSPredicate Thanks!

bear
  • 11,364
  • 26
  • 77
  • 129
  • Please read the [Core Data Programming Guide](https://developer.apple.com/library/ios/documentation/cocoa/Conceptual/CoreData/cdProgrammingGuide.html) from Apple. CD isn't a framework you can learn as you go, you'll get yourself into bad spots really quick and will have to unlearn bad habits. – RyanR Oct 26 '13 at 18:11

1 Answers1

0

Create an NSPredicate to have task == the task from selected cell. Use this predicate filter the the NSSet that you get when asking for the tasks property on the group-class. If you already did this, please show the code that is doing this, so we can see what exactly is that is going wrong.

Can you also give a screenshot of (the relevant part of) your model and indicate whether you have NSManagedObject subclasses for the entities?

Joride
  • 3,722
  • 18
  • 22