• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSMutableArray morphs itself into an NSArray?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSMutableArray morphs itself into an NSArray?


  • Subject: Re: NSMutableArray morphs itself into an NSArray?
  • From: Allan Odgaard <email@hidden>
  • Date: Tue, 9 Mar 2004 15:03:32 +0100

On 9. Mar 2004, at 14:20, Jerry Krinock wrote:

Is it possible that Fink somehow patches his
system to make it more sensitive to my mistakes?

I sincerely doubt it -- many methods which are declared to return an NSArray actually do return an NSMutableArray (which is why your code works) -- if you read the release notes you'll see that Apple is actually changing some methods which previously did return a mutable array to returning an immutable.

One possible implementation of stringsSeperatedByComponent: could be something like this:

NSRange r = [self rangeOfString:component];
if(r.location == NSNotFound)
return [NSArray arrayWithObject:self];

NSMutableArray* res = [NSMutableArray array];
do {
...
} while(...);

return res;

So you see, wether or not the result is mutable would depend on input!
_______________________________________________
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.


References: 
 >Re: NSMutableArray morphs itself into an NSArray? (From: Jerry Krinock <email@hidden>)

  • Prev by Date: Re: modal windows (again)
  • Next by Date: Re: Encapsulate C struct/toll-free bridging?
  • Previous by thread: Re: NSMutableArray morphs itself into an NSArray?
  • Next by thread: Re: NSMutableArray morphs itself into an NSArray?
  • Index(es):
    • Date
    • Thread