Method Sees Populated Array As Empty
Method Sees Populated Array As Empty
- Subject: Method Sees Populated Array As Empty
- From: Mark Wales <email@hidden>
- Date: Sat, 5 Jul 2008 22:36:07 +0100
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 everything works fine, except for when I use the
- (NSData *)dataOfType:(NSString *)typeName error:(NSError **)outError
method to save. I've put an NSLog("%@", arrayOfReferences) at the
beginning of this method and the array comes out as empty, even though
with every other method it is populated as it should be. This means I
can't get to its contents in order to save it (it just saves the empty
array - all the objects it contains implement NSCoding properly, but
the problem is before any coding even happens, the method sees the
array as empty).
Is there any reason why a method would read an array as empty when
every other method has no problems accessing it? I can't work it out
and it's really annoying: should have only taken a few minutes to
implement save.
Thanks in advance for any help,
Mark
-----------------------------------------------------------------------
Home: email@hidden
Blog: http://neo-sophistry.blogspot.com/
-----------------------------------------------------------------------
_______________________________________________
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