I have and array of many strings. I wan't to sort them into a dictionary, so all strings starting the same letter go into one array and then the array becomes the value for a key; the key would be the letter with which all the words in it's value's array begin.
Example
Key = "A" >> Value = "array = apple, animal, alphabet, abc ..."
Key = "B" >> Value = "array = bat, ball, banana ..."
How can I do that? Thanks a lot in advance!
Use this to sort the contents of array in alphabetical order, further you design to the requirement
[keywordListArr sortUsingSelector:@selector(localizedCaseInsensitiveCompare:)];
You can achieve what you want through the following steps:
Here is the Objective-C code for these steps. Note that I am assuming that you want the keys to be case insensitive.
I just wrote this sample. It looks simple and does what you need.
Take a look at this topic, they solves almost the same problem as you — filtering NSArray into a new NSArray in objective-c Let me know if it does not help so I will write for you one more code sample.