• 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: NSDate dateWithNaturalLanguageString goes BOOM! after being called 100, 000+ times
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSDate dateWithNaturalLanguageString goes BOOM! after being called 100, 000+ times


  • Subject: Re: NSDate dateWithNaturalLanguageString goes BOOM! after being called 100, 000+ times
  • From: Nicko van Someren <email@hidden>
  • Date: Thu, 31 Mar 2005 11:35:13 +0100

On 31 Mar 2005, at 06:43, Daniel DeCovnick wrote:

Just as a followup, in case my last sentence wasn't clear, it should look like this:
int i;
for (i = 0; i < 500000; i++)
{
NSAutoreleasePool *p = [[NSAutoreleasePool alloc] init];
NSDate *date = [NSDate dateWithNaturalLanguageString:@"12/14/04"];
NSLog(@"%d", i);
[p release];
}



For effciency you might be better off with:

NSAutoreleasePool *p = nil;
for (i = 0; i < 500000; i++)
{
	if ((i % 1000) == 0) {
		[p release];
		p = [[NSAutoreleasePool alloc] init];
	}
     NSDate *date = [NSDate dateWithNaturalLanguageString:@"12/14/04"];
     NSLog(@"%d", i);
}
[p release];

	Nicko

_______________________________________________
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


References: 
 >Insetting a complex NSBezierPath shape? (From: Keith Blount <email@hidden>)
 >NSDate dateWithNaturalLanguageString goes BOOM! after being called 100, 000+ times (From: Kane Dijkman <email@hidden>)
 >Re: NSDate dateWithNaturalLanguageString goes BOOM! after being called 100, 000+ times (From: Charilaos Skiadas <email@hidden>)
 >Re: NSDate dateWithNaturalLanguageString goes BOOM! after being called 100, 000+ times (From: Daniel DeCovnick <email@hidden>)
 >Re: NSDate dateWithNaturalLanguageString goes BOOM! after being called 100, 000+ times (From: Daniel DeCovnick <email@hidden>)

  • Prev by Date: Cocoa & STL
  • Next by Date: Re: Adding custom NSView to cell in NSTableView
  • Previous by thread: Re: NSDate dateWithNaturalLanguageString goes BOOM! after being called 100, 000+ times
  • Next by thread: More Newbie Trouble with Basic Bindings
  • Index(es):
    • Date
    • Thread