Hi everyone,
I'm planning on developing a pretty basic note taking app for students that would allow them to add a number of Subjects and then create notes against each subject. This is my first time developing with Objective-C and Cocoa so needless to say I have a few questions.
I'm at the stage where I'm trying to develop the data model for the app. The plan is to have an NSOutlineView on the left hand side that will display all the Subjects for the user and allow them to add/delete them. When a Subject is clicked on, I would like all the related Notes will appear on the right hand side within an NSTableView (along the lines of how iPhoto & iTunes work). At the moment I've created a data source for my NSOutlineView that is an array of Subject Objects. Each Subject object has a title and an array called notesForSubject. This array will store instances of my Notes Object, which at the moment just contains a title and a date. So far I've created a basic app that contains an NSOutlineView and has a button that allows me to create new instances of my Subject class and add them to the data source array:
I'm happy enough with this but I'm stuck on how to get the contents of the notesForSubject array to display when a Subject is selected. I'm just wondering if the way I've gone about setting up my data in terms of classes etc is the best way to do this. I also plan on using core data but I've not got round to learning that yet.
Just wondering what you guys think? Any thoughts/advice you may have would be much appreciated.
Thanks
I'm planning on developing a pretty basic note taking app for students that would allow them to add a number of Subjects and then create notes against each subject. This is my first time developing with Objective-C and Cocoa so needless to say I have a few questions.
I'm at the stage where I'm trying to develop the data model for the app. The plan is to have an NSOutlineView on the left hand side that will display all the Subjects for the user and allow them to add/delete them. When a Subject is clicked on, I would like all the related Notes will appear on the right hand side within an NSTableView (along the lines of how iPhoto & iTunes work). At the moment I've created a data source for my NSOutlineView that is an array of Subject Objects. Each Subject object has a title and an array called notesForSubject. This array will store instances of my Notes Object, which at the moment just contains a title and a date. So far I've created a basic app that contains an NSOutlineView and has a button that allows me to create new instances of my Subject class and add them to the data source array:

I'm happy enough with this but I'm stuck on how to get the contents of the notesForSubject array to display when a Subject is selected. I'm just wondering if the way I've gone about setting up my data in terms of classes etc is the best way to do this. I also plan on using core data but I've not got round to learning that yet.
Just wondering what you guys think? Any thoughts/advice you may have would be much appreciated.
Thanks