All.
I have a NSMutableArray , which name is dummyPerson. And it’s element is NSMutableDictionary. Like this following code. I want to exclude duplicated screenName.
“`
self.dummyPeople = [{screenName: "apple",tweet: "hi"},{screenName:"orange",tweet:"foo"},{screenName:"apple",tweet: "hoge"}];
// filteredByScreenName is procedure code.
[self.dummyPeople filteredByScreenName]
#=> return [{screenName:"apple",tweet:"hi"},{screenName:"orange",tweet:"foo"}];
“`
Do you have any Idea? Thanks in advance.
Well, not going to write code for you, but here is what I would do:
Create a temporary array to hold found names. Then go through each dictionary in your array. If your temp array has the screen name, skip it, otherwise take it and add the name to the temp array.