You should not create a new instance of MyDocument in your xib file.
So, the solution is pretty simple. Delete the MyDocument object in
your xib file, and bind all action, target and other that was
targetting it to the 'File Owner'.
That works perfectly! Thanks very much – that'll teach m
Le 6 juil. 08 à 13:47, Mark Wales a écrit :
So the document instance changes I guess. Why would that happen
and how can
I stop it?
Only your code could tell us why.
The MyDocument.m file is pretty long so I don't want to post it on
here, and it links to other files too. So here's the f
So the document instance changes I guess. Why would that happen and
how can
I stop it?
Only your code could tell us why.
The MyDocument.m file is pretty long so I don't want to post it on
here, and it links to other files too. So here's the full source code
instead: http://www.think-yak.
On Sun, Jul 6, 2008 at 4:26 AM, Mark Wales <[EMAIL PROTECTED]> wrote:
> So the document instance changes I guess. Why would that happen and how can
> I stop it?
Only your code could tell us why.
-Shawn
___
Cocoa-dev mailing list (Cocoa-dev@lists.apple
Try NSLog(@"%@", self) and make sure your are working with the same
document instance and not with two distincs documents objects (one
with a full array and one with an empty array).
Ok, that seems to have done something. When I use the NSLog(@"%@",
self) in all the other methods I get:
Try NSLog(@"%@", self) and make sure your are working with the same
document instance and not with two distincs documents objects (one
with a full array and one with an empty array).
Le 6 juil. 08 à 12:26, Mark Wales a écrit :
Do you actually have an accessor method for arrayOfReferences?
Do you actually have an accessor method for arrayOfReferences?
Yes, there is one. I didn't copy the full code in, but there is a
synthesised setter for arrayOfReferences. I tried doing it manually
too and added an NSLog in there. Again the array only came up as empty
when called from that
On 6 Jul 2008, at 8:29 am, Mark Wales wrote:
@interface MyDocument : NSDocument
{
NSMutableArray *arrayOfReferences;
}
NSLog(@"%@", [self arrayOfReferences]); // <== Shows the array
as empty
Do you actually have an accessor method for arrayOfRef
On Sat, 5 Jul 2008 22:36:07 +0100, Mark Wales <[EMAIL PROTECTED]>
said:
>Hello,
>
>I'm trying to get a document based app to save the contents of an
>array (NSMutableArray *arrayOfReferences) that is declared and
>initialised in the MyDocument.m. Whenever any method in MyDocument.m
>or other classe
Is there any reason why a method would read an array as empty when
every other method has no problems accessing it?
I don't think so. More likely is that you are accessing an array
that is either empty or nil. It's impossible to tell without seeing
the code but my guess would be that you're
On Jul 5, 2008, at 2:36 PM, Mark Wales wrote:
Is there any reason why a method would read an array as empty when
every other method has no problems accessing it?
I don't think so. More likely is that you are accessing an array that
is either empty or nil. It's impossible to tell without seei
11 matches
Mail list logo