NSMutableArray morphs itself into an NSArray?
NSMutableArray morphs itself into an NSArray?
- Subject: NSMutableArray morphs itself into an NSArray?
- From: Jerry Krinock <email@hidden>
- Date: Mon, 08 Mar 2004 06:30:51 -0800
In my application, in a subclassed NSWindowController, I declare the
following member object:
NSMutableArray* crontabLines;
During my subclassed -initWindowWithNibName, I alloc/init it:
crontabLines = [NSMutableArray array] ;
[crontabLines retain] ;
Later, in a member method, I use it to temporarily store several NSString*s,
and then retain it.
Later still, I re-use it similarly in another method. This works fine, at
least on my computer and apparently for hundreds of other users. However,
one user has sent me my stdout which shows that, in this second usage, the
first time I send it a message:
[crontabLines removeAllObjects];
we get:
*** -[NSCFArray removeAllObjects]: mutating method sent to immutable object
Now, I have seen this myself when sending this -removeAllObects to an
NSArray. Duh. But as you can see this thing is declared and inited as
mutable. I know he's running my latest version because the stdout says so.
Also, he says he is running the same OS as I, 10.3.2.
Is there any way that an NSMutableArray can morph into a NSArray?
(I know there's a lot more troubleshooting I can do, such as have him send
me all related files, try it on a "clean" account, etc.)
Jerry Krinock
San Jose, CA USA
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.