• 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: Simplifying this code?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Simplifying this code?


  • Subject: Re: Simplifying this code?
  • From: "Theodore H. Smith" <email@hidden>
  • Date: Thu, 29 Jul 2004 17:55:34 +0100

Thanks Shawn,

I've been studying this document you mentioned. It leads to a lot of new information... NSDocuments, undo, scripting, archivers, serialisers, window controllers...

Looks like I have a choice of:

1) Getting to grips with all that, which mostly means studying the API and finding a good tutorial. (I haven't found an NSDocument or NSUndoManager tutorial). I'm thinking when my model implements an NSCoder protocol, I'm still going to have to manually code references to each object variable! I'll have to refactor my design also because its all written around saving the interface the C way, generally my most despised task.

2) Just manually code references to a few object variables, and do it the C style way.

So really, if I wanted to get the job done, I'd use the C-style way. If I wanted to learn about Cocoa, I'd do it the Cocoa way. I think I'm going to do it the Cocoa way. I wonder why I can't find any tutorials on NSDocument, NSUndoManager and the rest? It seems there is a steep learning curve with the API at first.

The question you need to ask yourself is what data do you need to store and why?

I need the parameters of my fractal stored. Turning angles, cut off lengths, etc. I need them stored as a string so I can put it into an NSDictionary, for caching pictures.

I doubt you need to save the view but simply the state of some of the view elements. What is the state you need saved related to "MyProgress".

None. The progress bar is invisible, until the draw operation begins, where it is updated. Once the draw operation has ended, the progress bar is made invisible again.

<http://developer.apple.com/documentation/Cocoa/Conceptual/ AppArchitecture/index.html>

Thats what I was missing!

--
Theodore H. Smith - Software Developer.
http://www.elfdata.com
_______________________________________________
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: Simplifying this code?
      • From: Shawn Erickson <email@hidden>
References: 
 >Re: Simplifying this code? (From: "Theodore H. Smith" <email@hidden>)
 >Re: Simplifying this code? (From: Shawn Erickson <email@hidden>)

  • Prev by Date: Re: DVD Studio Pro
  • Next by Date: NSTableView, bindings, auto-sorting
  • Previous by thread: Re: Simplifying this code?
  • Next by thread: Re: Simplifying this code?
  • Index(es):
    • Date
    • Thread