MANGA
MANGA

Reputation: 27

SearchBar doesn't work when I type the uppercase alphabet

In my iPhone app, I have a SearchBar and when people type a keyword and click to search, the search result will show in UILabel.

Everything works fine but when I type a keyword which starts with uppercase letters, the search does not work as it should. I know I have to do something but don´t know what.

Anybody have an idea?

Upvotes: 0

Views: 389

Answers (1)

Mahesh Velaga
Mahesh Velaga

Reputation: 21991

May be its trying to match the case as well, try converting the keyword to lower or uppercase and also convert the string with which you are comparing to the same case (lower or upper).

One more option is to specify the search comparison to be case-insensitive, if you are using some built-in functions for that.

Thanks

Upvotes: 1

Related Questions