I'm currently thinking about the modeling of data in an iPhone app. My first instinct is to try to normalize the data into entities.
For example a Professor entity might look something ilke this:
@interface Professor : NSManagedObject {
}
@property (nonatomic, retain) NSString * profID;
@property (nonatomic, retain) NSString * firstName;
@property (nonatomic, retain) NSString * lastName;
@property (nonatomic, retain) NSString * officeLocation;
@end
And an AvailableClass might look like this:
@interface AvailableClass : NSManagedObject {
}
@property (nonatomic, retain) NSString * className;
@property (nonatomic, retain) NSString * classAbstract;
@end
Now, we can pair the professors against the classes they teach using something like this:
@interface OfferedClass : NSManagedObject {
}
@property (nonatomic, retain) Professor * prof;
@property (nonatomic, retain) AvailableClass * classDetail;
@end
If I want a view which lists a catalog of all
OfferedClasses(that is, there is a professor assigned to a defined class) does this mean I need multipleFetchRequestControllersand that I'll be doing multple queries in mytableView: cellForRowAtIndexPath:method?It appears to me that I can create and add instances of
ProfessorandAvailableClass, then later add instances ofOfferedClassby getting values forprofandclassDetailfrom their respectivefetchedResultsController.
Am I close on any of this?