• 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: NSMutableArray + NSEnumerator = No Memory
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSMutableArray + NSEnumerator = No Memory


  • Subject: Re: NSMutableArray + NSEnumerator = No Memory
  • From: James Bucanek <email@hidden>
  • Date: Mon, 24 Sep 2007 10:01:45 -0700

Alastair Houghton <mailto:email@hidden> wrote (Monday, September 24, 2007 7:58 AM +0100):
If the code Chris gave is too slow, you could:

1. Change it to get an IMP for -objectAtIndex:, then re-test.

2. Change it to use CFArrayGetValueAtIndex(), then re-test.

Those are excellent suggestions.

For the record, I replaced my NSEnumerator with a loop that calls -[NSArray count] once to get the size, then calls -[NSArray objectAtIndex:] for each element. The performance is essentially identical to the loop that uses NSEnumerator (within 1%).

--
James Bucanek

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Re: NSMutableArray + NSEnumerator = No Memory (From: Alastair Houghton <email@hidden>)

  • Prev by Date: Re: NSMutableArray + NSEnumerator = No Memory
  • Next by Date: Re: Issue with getting availableData from NSFileHandle on Intel Mac.
  • Previous by thread: Re: NSMutableArray + NSEnumerator = No Memory
  • Next by thread: Re: NSMutableArray + NSEnumerator = No Memory
  • Index(es):
    • Date
    • Thread