I am trying to use emoticons for my chat application. I am comparing the string I get or I send with a local string. If I am get the result as true I want to replace the string with an image. For that matter I am not using may emoticons.
I am trying this:
NSRange textRange;
textRange =[text rangeOfString:@":)"];
if(textRange.location != NSNotFound)
{
//Does contain the substring
}
else
{
// replace string with image.
}
But I am not able to figure out how to replace image at the string position.
I assumed you want to put smileys.
So you can try this :
For more detail please refer this link.