• 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
NSMutableArray morphs itself into an NSArray?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.


  • Follow-Ups:
    • Re: NSMutableArray morphs itself into an NSArray?
      • From: mmalcolm crawford <email@hidden>
    • Re: NSMutableArray morphs itself into an NSArray?
      • From: Dustin Voss <email@hidden>
  • Prev by Date: Re: NSArrayController and
  • Next by Date: Re: AuthorizationExecuteWithPrivileges and CFpreferences issues
  • Previous by thread: Re: cocoa-dev digest, Vol 2 #3798 - 13 msgs
  • Next by thread: Re: NSMutableArray morphs itself into an NSArray?
  • Index(es):
    • Date
    • Thread