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

Re: isEqualToString


  • Subject: Re: isEqualToString
  • From: Shawn Erickson <email@hidden>
  • Date: Sat, 12 Jul 2003 18:09:53 -0700

On Saturday, July 12, 2003, at 05:32 PM, John MacMullin wrote:

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.

They are not equal because of a case difference... "to" does not equal "To". If you want case insensitive compare use NSString's caseInsensitiveCompare: method.

Note sending description to a string is redundant and not needed. Also you can print an NSString (or any object) using NSLog easily by using the %@ printf statement.

I would also move the loading of the bundle string outside of the loop and possibly only do it once in your whole application if it is not expected to change while running.

-Shawn
_______________________________________________
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.

References: 
 >isEqualToString (From: John MacMullin <email@hidden>)

  • Prev by Date: How to construct Unicode Safe Strings in the source?
  • Next by Date: Renaming Files/Folders
  • Previous by thread: Re: isEqualToString
  • Next by thread: Renaming Files/Folders
  • Index(es):
    • Date
    • Thread