This is not a site where other people write code for you. It's a site for help solving problems for yourself.
Take a look at the NSString class. There are a number of methods for searching for substrings, breaking up strings using a delimiter, etc. Take a look at rangeOfString and it's variations. Also look at componentsSeparatedByString, which will break up a word into substrings.
You could break the string into substrings using componentsSeparatedByString, then use the array of strings to initialize an NSCountedSet. That would give you your desired result in about 2 lines of code.
There is also NSScanner, which you can use to search for substrings in a string.
Off the top of my head I can think of 3 or 4 ways to solve your problem using those tools. Take a stab at it and see what you can come up with. If you have problems making your ideas work, THEN come back for help.