• 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: NSArray losing its data
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSArray losing its data


  • Subject: Re: NSArray losing its data
  • From: "Jean-Olivier Lanctôt-D." <email@hidden>
  • Date: Sun, 17 Nov 2002 13:43:19 -0500

1) initWithCapacity is a NSMutableArray -only instance method.
2) If you claim that [[NSMutableArray alloc]
initWithCapacity:0] returns an autoreleased instance, then explain me the diff. between

[[NSMutableArray alloc] initWithCapacity:i]
and
[NSMutableArray arrayWithCapacity:i]

Why do you initWithCapacity:0? You didn't answer that question.
From the doc

- (id)initWithCapacity:(unsigned)numItems

Initializes a newly allocated array, giving it enough memory to hold numItems objects. Mutable arrays expand as needed, so numItems simply establishes the object's initial capacity. Returns self.

If you ask the array to init with 0 numItems, then you can't add NOTHING to that array.
Right?

-- Jean-Olivier
_______________________________________________
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: NSArray losing its data
      • From: Ondra Cada <email@hidden>
  • Prev by Date: Re: Jobs
  • Next by Date: Re: What's with the Sherlock SDK?
  • Previous by thread: NSArray losing its data
  • Next by thread: Re: NSArray losing its data
  • Index(es):
    • Date
    • Thread