• 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: Mutable != Mutable ?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Mutable != Mutable ?


  • Subject: RE: Mutable != Mutable ?
  • From: "Jonathan E. Jackel" <email@hidden>
  • Date: Mon, 4 Aug 2003 14:11:20 -0400

So how are you making the objects that are in lineArray?

> -----Original Message-----
> From: email@hidden
> [mailto:email@hidden]On Behalf Of Michael Hanna
> Sent: Monday, August 04, 2003 1:41 PM
> To: email@hidden
> Cc: email@hidden
> Subject: Re: Mutable != Mutable ?
>
>
> No, but thanks for the 'heads-up'. I imagine it's going to take me
> about a year before I get fairly-well versed in writing Cocoa programs.
> It's a good thing that there's a relatively-high payoff during the
> learning process; I can imagine many people would give up otherwise.
>
> Michael
>
> On Monday, August 4, 2003, at 12:07 PM, Jonathan E. Jackel wrote:
>
> >> theLine = [lineArray objectAtIndex:i]; // retrieve a line
> >
> > How are you making the objects that are in lineArray? Are you, by any
> > chance, using NSString's componentsSeparatedByString method? Or using
> > an
> > NSScanner? If so, your array contains immutable strings. Simply
> > assigning
> > them to an NSMutableString * doesn't turn them into mutable strings. A
> > possible workaround, assuming lineArray is mutable, is:
> >
> > theLine = [[[lineArray objectAtIndex:i] mutableCopy] autorelease];
> >
> > //then change theLine, then
> >
> > [lineArray replaceObjectAtIndex:i withObject:theLine];
> >
> > You could also reverse the last two steps. Or you could create you
> > could
> > just put mutable strings in your array in the first place.
> >
> > Jonathan
> > _______________________________________________
> > 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.
> _______________________________________________
> 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.
_______________________________________________
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: Mutable != Mutable ?
      • From: Michael Hanna <email@hidden>
References: 
 >Re: Mutable != Mutable ? (From: Michael Hanna <email@hidden>)

  • Prev by Date: Re: Question about line breaks and file types
  • Next by Date: Re: Mutable != Mutable ?
  • Previous by thread: Re: Mutable != Mutable ?
  • Next by thread: Re: Mutable != Mutable ?
  • Index(es):
    • Date
    • Thread