Comparing Case Insensitive Strings in ObjC


i have looked around online this, can't seem find anything. makes me think i'm either missing or not looking right place, that's why i'm bringing here.

compare strings in objc , ignore case of letters in each string. have comparing strings down, can't figure out how compare them while ignoring case.

example, getting "hello" = "hello"
or "hello" = "hello"

1 string comes user input via textfield. have set-up this:

nsstring *fieldoftext = fieldtext.text;

other string comes "if" statement. have set-up this:

if ( [fieldoftext isequaltostring:mad:"hello"])
{
dosomething
}
else if ( ![fieldoftext isequaltostring:mad:"hello"])
{
dosomethinglikedisplayalert
}

best way ignore/compare strings while ignoring cases?

reading, , in advance!
 

did open documentation , @ comparison methods? if reason you're not using method designed this?

caseinsensitivecompare:
 


Forums iPhone, iPad, and iPod Touch iOS Programming


  • iPhone
  • Mac OS & System Software
  • iPad
  • Apple Watch
  • Notebooks
  • iTunes
  • Apple ID
  • iCloud
  • Desktop Computers
  • Apple Music
  • Professional Applications
  • iPod
  • iWork
  • Apple TV
  • iLife
  • Wireless

Comments