• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Opening a window in Core Data application
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Opening a window in Core Data application


  • Subject: Re: Opening a window in Core Data application
  • From: Wayne Pascoe <email@hidden>
  • Date: Fri, 31 Mar 2006 16:42:40 +0100


On 30 Mar 2006, at 22:42, Joshua Scott Emmons wrote:

Yup. To flesh it out a little, MVC is your Model, your View, and your Controller. Model, in this case, being your managed object model set up with Core Data. Your view being your tables, buttons, text fields, and other things that interact with the user. The controller(s) are all the things that "glue" the View and the Model together.

The key is that the View should know nothing about the Controller or the Model, and the Model should know nothing about the Controller or the View. This helps clarity, reusability, and (in the long run) sanity.

See http://tinyurl.com/kpk9a for the hows and whys. In particular, I think this: http://tinyurl.com/f4pzm is worth a thousand words.

I think I understand it a lot better now, and I also think I understand partly where I have been going wrong and why. I've been trying to shove stuff into the ArrayController, as I have seen this as my controller. This isn't the case - the automatically created Alexandria_AppDelegate is the actual controller I should be using. The ArrayController is actually part of the model, but I saw the word controller and went for it :)


I keep it simple. Make an outlet and connect your array controller to it. If you're still confused about outlets and connecting them in IB, you really need to hit some of the remedial Cocoa documentation and examples. I'm not trying to be dismissive, it's just that it's a basic concept that is covered in a lot of the early docs and isn't really spelled out anywhere (that I can remember).

I've just checked and it turns out I actually do know what that is about. I just wasn't seeing the array controllers as seperate objects that I can just connect outlets to. For some reason I thought that they were special.


Think of iTunes. One big table displays popular parameters (song title, my rating, album name...). The rest (Composer, Disc Number, Equalizer Preset...) can be accessed by going to File->Get Info.

If for some reason, you have data that's hard to fit into a table or inspector (large images, graphs, sound clips, whatever), you might want to look at a master-detail intervace. It takes a little more space than just a table, but it can be made to be collapsable (click on the disclosure triangle, and the detail-interface expands, for example). http://tinyurl.com/ljxxc gives a pretty good over view of using M/D interfaces with core data.

In my case, the archive screen should show the basics about the archive, so I'll make that editable. The downside is that a single archive could comprise of hundreds of files, so I think the master- detail interface is not appropriate. An inspection panel might be appropriate, but it will have to be scrollable / searchable because of the potential number of files involved.


I think I'll just make v0.1 a prototype to learn some stuff and then take it from there :)

Thank you very much for all the links and tips - they have been very valuable to me.

--
Wayne Pascoe    (gpg --keyserver www.co.uk.pgp.net --recv-keys 79A7C870)
You have zero privacy anyway, get over it
- Scott McNealy

Attachment: PGP.sig
Description: This is a digitally signed message part

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Opening a window in Core Data application
      • From: "I. Savant" <email@hidden>
References: 
 >Opening a window in Core Data application (From: Wayne Pascoe <email@hidden>)
 >Re: Opening a window in Core Data application (From: Joshua Scott Emmons <email@hidden>)
 >Re: Opening a window in Core Data application (From: Wayne Pascoe <email@hidden>)
 >Re: Opening a window in Core Data application (From: Joshua Scott Emmons <email@hidden>)

  • Prev by Date: Re: Help in 2 Diamensional Array
  • Next by Date: Re: Getting Carbon events in Cocoa
  • Previous by thread: Re: Opening a window in Core Data application
  • Next by thread: Re: Opening a window in Core Data application
  • Index(es):
    • Date
    • Thread