• 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
Documents & Controllers
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Documents & Controllers


  • Subject: Documents & Controllers
  • From: Seth Willits <email@hidden>
  • Date: Sun, 10 Aug 2003 10:34:01 -0700

For the longest time, before I really dived in to Cocoa, I could never understand how to create a multi document application. I had seen the very simple examples, and the others which showed how to create them *without* NSDocument and the others, but I had never seen one that was small enough to be readable and used the provided document classes.

Then I dived in. Once I realized what First Responder was all about, it made a whole lot of sense and I wrote a whole lot of code. Yet I find myself stuck when going to implement file reading and saving. I looked in Cocoa Programming, but all it has is a large chapter on *not* using NSDocument & the like, so I looked in Learning Cocoa w/ Objective-C but as I remember it was a very simple example which didn't quite explain or demonstrate what should go where, and the examples I've looked at don't fit, TextEdit doesn't use the provided classes, Sketch is too different from what I'm doing to make sense to me, and I haven't found any others that are any different.

I'm really struggling to find a clear and concise example, with an explanation if at all possible, which demonstrates reading data from a file, setting values in the interface, having the interface control changing those values, and then saving them back to a file. Now the most simplistic "build your own text editor" example shows this, but it does things "the easy way" (and they all say that) by not using all of the classes, and making a class serve a dual purpose. I'm really looking for a rigid "here's an NSDocument subclass and here's an NSWindowController subclass, and here's how they work together to load a file, set interface values, set values in the document model, and save to a file."

Is this crazy and out of the question? It seems so obvious that I should be able to find this but I must be missing something because I have yet to find this!

<bangs head on the wall>

I feel so stuuupid!


<Goes to watch CART race...>

Seth Willits
------------------------------------------------------------------------ ---
President and Head Developer of Freak Software - http://www.freaksw.com
Q&A Columnist for REALbasic Developer Magazine - http://www.rbdeveloper.com
Webmaster for REALbasic Game Central - http://www.freaksw.com/rbgames

"When purchasing that gift for your Special Someone guys remember, girls
like cute things. If it makes you want to puke, your chick will totally
love it."
-- Someone else out There
------------------------------------------------------------------------ ---
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
  • Follow-Ups:
    • Re: Documents & Controllers
      • From: publiclook <email@hidden>
  • Prev by Date: Setting focus to text field in drawer
  • Next by Date: Setting focus to text field in drawer
  • Previous by thread: Re: Setting focus to text field in drawer
  • Next by thread: Re: Documents & Controllers
  • Index(es):
    • Date
    • Thread