• 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: License file in Document Architecture
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: License file in Document Architecture


  • Subject: Re: License file in Document Architecture
  • From: "I. Savant" <email@hidden>
  • Date: Thu, 26 Oct 2006 11:41:36 -0400


Is there some specific reason you need to open your license file as a document, using the Cocoa document architecture? If not, then avoid the hassle of short-circuiting time-tested Cocoa mechanisms and load your license information as part of your preferences or in your app delegate when your app launches (say, in the - applicationDidFinishLaunching: delegate method).


You can accomplish this with NSData and NSString (whichever is appropriate for the format of your license file). Use NSString's +stringWithContentsOfFile: or NSData's +dataWithContentsOfFile: to read in the file's contents and manipulate it as necessary.

The details for all the classes and their methods are easily found in the docs and I thin you'll find this approach a *lot* easier .

--
I.S.


On Oct 26, 2006, at 10:28 AM, Kevin Hoctor wrote:

I have a program that uses the document architecture to manage multiple NSDocument subclasses (DQDocument). I just added the ability for it to read a license file (double-click support from the Finder) by adding another subclass (DQLicense) but I've had to use some workarounds to keep this method happy. I had to subclass NSDocumentController to keep the license file out of the recent file list and I've had to add a nib to quiet a warning. Now I'm finding that it sees this document as open still and I'll have to add one more workaround.

Is this the best way to handle opening a file that is not actually used in the program as a primary NSDocument?

Peace,
Kevin Hoctor
No Thirst Software
http://nothirst.com



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


This email sent to email@hidden

_______________________________________________ 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: License file in Document Architecture
      • From: Kevin Hoctor <email@hidden>
References: 
 >License file in Document Architecture (From: Kevin Hoctor <email@hidden>)

  • Prev by Date: Re: Opening a folder in the Finder from my app
  • Next by Date: Re: License file in Document Architecture
  • Previous by thread: License file in Document Architecture
  • Next by thread: Re: License file in Document Architecture
  • Index(es):
    • Date
    • Thread