Re: NSMutableArray morphs itself into an NSArray?
Re: NSMutableArray morphs itself into an NSArray?
- Subject: Re: NSMutableArray morphs itself into an NSArray?
- From: Jerry Krinock <email@hidden>
- Date: Tue, 09 Mar 2004 05:20:00 -0800
Thanks to all, I think I have this problem solved, except I want to know why
my application runs fine, despite my mistake, on the 3 Macs we have here,
and apparently a thousand other satisfied users', but not on this one
user's. (He has a second, possibly unrelated issue, that I need to work on
too.)
I want a system like his for testing!! I think we all need one. He told me
that he has Fink installed. Is it possible that Fink somehow patches his
system to make it more sensitive to my mistakes?
Jerry
Here is a summary of the error:
// declare as mutable array:
NSMutableArray* crontabLines ;
...
// but the following mistake morphs it into an immutable array
// since -componentsSeparatedByString returns an NSArray*:
crontabLines =
(NSMutableArray*)[aString componentsSeparatedByString: @"\n"];
// later, upon sending it a mutating message, his system barfs:
*** -[NSCFArray removeAllObjects]: mutating method sent to immutable object
// but why only on this one system!!
_______________________________________________
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.