Re: Guidance for learner
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