• 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
isEqualToString
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

isEqualToString


  • Subject: isEqualToString
  • From: John MacMullin <email@hidden>
  • Date: Sat, 12 Jul 2003 17:32:08 -0700

I have tried numerous combinations to get the following code to work.
I am trying to compare an NSArray string object to a bundle string.
Any help in getting the "isEqualToString" to work would be greatly
appreciated. I have tried ([accessString isEqualToString: [[self
recordForRow:i] objectAtIndex:2] ]) also and that doesn't compare
correctly either.

for (i=0; i< numRows; i++) {
if ([[userId stringValue] isEqualToString: [[self
recordForRow:i] objectAtIndex:0]]) {
validUserId = YES;
NSString * accessString = [ [NSBundle mainBundle]
localizedStringForKey:@"Access To All" value: nil table:nil];
NSLog(@"%s_recordString", [[[self recordForRow:i]
objectAtIndex:2]UTF8String]);
NSLog(@"%s_bundleString", [[accessString
description]UTF8String]);
if ( [[accessString description] isEqualToString: [[self
recordForRow:i] objectAtIndex:2] ]) {
NSLog(@" IsUserAll yes");
isUserAll = YES;
} else {
isUserAll = NO;
NSLog(@" IsUserAll no");
}
break;
}
};

The following NSLog output, from the code above, shows the strings to
be equal:

2003-07-12 17:25:00.865 GLASS[19889] Access to All_recordString
2003-07-12 17:25:00.865 GLASS[19889] Access To All_bundleString
2003-07-12 17:25:00.866 GLASS[19889] IsUserAll no

Again, any help would be greatly appreciated.

John
_______________________________________________
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: isEqualToString
      • From: Shawn Erickson <email@hidden>
    • Re: isEqualToString
      • From: Julien Jalon <email@hidden>
  • Prev by Date: Re: getCString a good idea here?
  • Next by Date: Re: subclassing question
  • Previous by thread: Re: getCString a good idea here?
  • Next by thread: Re: isEqualToString
  • Index(es):
    • Date
    • Thread