Wich one is faster, compare or isEqualToString? (NSString methods)
Wich one is faster, compare or isEqualToString? (NSString methods)
- Subject: Wich one is faster, compare or isEqualToString? (NSString methods)
- From: Ignacio Enriquez <email@hidden>
- Date: Fri, 5 Jun 2009 21:20:08 +0900
Hi there;
Suppose I have
NSString *char = [[NSString alloc] initWithString:@"a"];
So, I wonder which is faster?
if([char isEqual:@"a"])
NSLog("it was a");
or
if([char compare:@"a"]==NSOrderSame)
NSLog("it was a");
or maybe is another faster than this two?
thanks in advance...
Ignacio
_______________________________________________
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