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
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.
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:
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
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
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 classes tries to access the arrayOfReferences it has no
problems and everyt