• 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: Guidance for learner
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Guidance for learner


  • Subject: Re: Guidance for learner
  • From: "Barry" <email@hidden>
  • Date: Thu, 28 Jun 2007 08:47:03 +0100

Alan & Daniel

Thanks to both for the help. Another bit of knowledge gained.

One more Question re:

If you want to have access to an instance of MyDocController it would
be done like this:

Access to AN instance->there already is ONE instance of NSDocController (or rather my subclass thereof) which has the dataFiles as an instance variable.


If I create other instances from every document then every instance of MyDocController will have the same (many Kb) of data to load.

I'm sure I've missed something fundamental here.
Especially as I've read that NSDocumentController is a 'singleton' and that there should only be ONE instance of it.


Barry

----- Original Message ----- From: "Alan Smith" <email@hidden>
To: "Barry" <email@hidden>
Cc: "Cocoa-list" <email@hidden>
Sent: Wednesday, June 27, 2007 11:24 PM
Subject: Re: Guidance for learner



Barry,

If you want to have access to an instance of MyDocController it would
be done like this:

@interface MyDocument : NSDocument
{
 MyDocController *myDocController;
}

and then in init or wherever you set up MyDocument:

myDocController = [[MyDocController alloc] init];

when it comes time to use it:

NSData *data = [[myDocController dataFiles] objectAtIndex: i];

Have fun!

Peace, Alan


--
// Quotes from Alan Smith -------------------------
"You don't forget, you just don't remember."
"Maturity resides in the mind."
"Silence is the Universe's greatest gift."
"When the World realizes that personal beliefs are not something to
argue or fight over, it shall evolve."

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Re: Guidance for learner (From: "Barry" <email@hidden>)
 >Re: Guidance for learner (From: "Alan Smith" <email@hidden>)

  • Prev by Date: Re: Managing the event loop in Cocoa
  • Next by Date: Re: Guidance for learner
  • Previous by thread: Re: Guidance for learner
  • Next by thread: Re: Guidance for learner
  • Index(es):
    • Date
    • Thread