• 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: Convert Arrays
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Convert Arrays


  • Subject: Re: Convert Arrays
  • From: "Alastair J.Houghton" <email@hidden>
  • Date: Wed, 22 Oct 2003 10:34:36 +0100

On Wednesday, October 22, 2003, at 12:31 am, Dustin Voss wrote:

On Tuesday, October 21, 2003, at 10:19 AM, Stiphane Sudre wrote:

myArray=[NSArray arrayWithObjects:@"It",@"s",@"almost",@"written",@"in",@"the",@"docume ntation",nil];

myMutableArray=[[myArray mutableCopy] autorelease];

myArray=[NSArray arrayWithArray: myMutableArray];


myArray = [myMutableArray copy];

would also work. The "copy" method does immutable copies, if the class in question has the concept of immutable vs. mutable.

Although you need to remember to autorelease it if you want the same effect as the other statements above.

Kind regards,

Alastair.
_______________________________________________
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: Convert Arrays (From: Dustin Voss <email@hidden>)

  • Prev by Date: Re: Aqua-style custom views
  • Next by Date: Re: NSTask and Notification?
  • Previous by thread: Re: Convert Arrays
  • Next by thread: setting the increment of all steppers
  • Index(es):
    • Date
    • Thread