| |||
| [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] |
long long result = 0, intermediate, base = 10 /* Adapt to suit */;
unsigned int initialPosition, newPosition;
NSCharacterSet *decimalDigits = [NSCharacterSet decimalDigitCharacterSet];
NSScanner *scanner = [NSScanner scannerWithString:myString];
//[scanner setCharactersToBeSkipped:[decimalDigits invertedSet]];
while (![scanner isAtEnd]) { initialPosition = [scanner scanLocation];
if ([scanner scanLongLong:&intermediate]) { newPosition = [scanner scanLocation];
while (initialPosition < newPosition) { result *= base; ++initialPosition; }
result += intermediate; }
[scanner scanUpToCharactersFromSet:decimalDigits intoString:nil]; }
Dunno if it's fast, but it's accurate.
Wade Tregaskis
ICQ: 40056898
AIM, Yahoo & Skype: wadetregaskis
MSN: email@hidden
iChat & email: email@hidden
Jabber: email@hidden
Google Talk: email@hiddenhttp://homepage.mac.com/wadetregaskis/
-- Sed quis custodiet ipsos custodes?
_______________________________________________ Do not post admin requests to the list. They will be ignored. Xcode-users mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/xcode-users/email@hidden
| References: | |
| >RE: Speeding up XCode? (From: Jeff Laing <email@hidden>) | |
| >Re: Speeding up XCode? (From: Robert Dell <email@hidden>) | |
| >Re: Speeding up XCode? (From: email@hidden) |
| Home | Archives | FAQ | Terms/Conditions | Contact | RSS | Lists | About |
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE
Contact Apple | Terms of Use | Privacy Policy
Copyright © 2007 Apple Inc. All rights reserved.