• 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: Mutating method sent to immutable object
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Mutating method sent to immutable object


  • Subject: Re: Mutating method sent to immutable object
  • From: Scott Stevenson <email@hidden>
  • Date: Sun, 10 Oct 2004 18:51:29 -0700


On Oct 10, 2004, at 6:36 PM, Bruce Truax wrote:

- (void)setExtraDataArray:(NSMutableArray *)newExtraDataArray {
if (extraDataArray != newExtraDataArray) {
[extraDataArray release];
extraDataArray = [newExtraDataArray copy];
}
}

And the array is initialized using:

[self setExtraDataArray:[NSMutableArray arrayWithCapacity:20]];


The problem is that -copy returns an immutable instance.

- Scott




--
http://treehouseideas.com/
http://theobroma.treehouseideas.com/ [blog]

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden
  • Follow-Ups:
    • Re: Mutating method sent to immutable object
      • From: Scott Stevenson <email@hidden>
References: 
 >Mutating method sent to immutable object (From: Bruce Truax <email@hidden>)

  • Prev by Date: Mutating method sent to immutable object
  • Next by Date: Re: Mutating method sent to immutable object
  • Previous by thread: Mutating method sent to immutable object
  • Next by thread: Re: Mutating method sent to immutable object
  • Index(es):
    • Date
    • Thread