NorimasaNabeta / CoreDataSPoT

Stanford CS193p 2013 Winter HomeWork5
0 stars 0 forks source link

RT4 recents view #4

Open NorimasaNabeta opened 11 years ago

NorimasaNabeta commented 11 years ago

The Recents tab should continue to meet all the requirements of the previous assignment. All Recents information should be stored in Core Data (i.e. do not use NSUserDefaults for Recents anymore).

NorimasaNabeta commented 11 years ago

HINT13 Both the predicate and the sortDescriptors for your Recents CoreDataTableViewController’s NSFetchedResultsController’s NSFetchRequest are going to depend on knowing when a photo in the database was last viewed, so it might be a good idea to have an attribute for that in your schema and make sure it gets set properly.

NorimasaNabeta commented 11 years ago

HINT12 The sorting in CoreDataTableViewController-based view controllers should happen automatically as part of the NSFetchRequest you use to create your NSFetchedResultsController. Just make sure it has the right NSSortDescriptor.

NorimasaNabeta commented 11 years ago

HINT8 “To many” relationships are represented simply as an NSSet of NSManagedObject instances. So to set the value of a property that is a to-many relationship from the “many” side (if you need to do this), just create an NSMutableSet, add NSManagedObject instances to it, then set the property to that NSMutableSet.

NorimasaNabeta commented 11 years ago

HINT7 Note that if you have a two-way relationship in your model, setting one side automatically sets the other side properly for you.