• 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
Model / View best practice
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Model / View best practice


  • Subject: Model / View best practice
  • From: "Kamrin Dahlin" <email@hidden>
  • Date: Mon, 3 Jul 2006 09:16:48 -0700
  • Thread-topic: Model / View best practice

Hi All,

I have a model that I am managing with a NSArrayController and who's view is a NSTableView.  Everything is working great, but my issue lays in the fact that I am displaying a file Icon and the filename in a single row of the "filename" column in my NSTableView.  I am using a NSAttributedString to accomplish this, and again this is working fine.  The NSAttributedString is memeber of my model class -- I am using bindings to display it in a NSTextViewCell of the NSTableView -- this NSAttributedString really doesn't have much to do with my model and in fact in order to get the right font, font size, and icon size for my table I end up setting view elements in my model, which seems like it breaks the practice of MVC.  Would there be a better way to do this -- a better practice?  As it stands now, I am hard coding the font, font size and icon size when i create the NSAttributedString, which doesn't allow for much flexability and since I don't really want to put a bunch of code into my model class so that I can change fonts, and fonts size's, scale the icon to my row height, etc, I was hoping someone might be able to suggest a better way to do this?

thx,

k
 _______________________________________________
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: Model / View best practice
      • From: Uli Kusterer <email@hidden>
  • Prev by Date: Re: Reg : Using Cocoa Framework in Cocoa Java Application.
  • Next by Date: Making a command line utility that links to the Application Services framework
  • Previous by thread: Re: NSMutable Data Crash
  • Next by thread: Re: Model / View best practice
  • Index(es):
    • Date
    • Thread