Possible Duplicate:
removing duplicates in nsarray
Hi friends,
I am storing the value in nsarray and i have to remove the duplicate dates.i mean exactly like this (14/12/2010,paid,15/12/2010,pending,15/12/2010,pending,16/12/2010,paid) should be (14/12/2010,paid,15/12/2010,pending,16/12/2010,paid). can any one suggest me the best way for removing duplicates that has 2 different day in it.
Thanks in advance.
Regards,
sathish
You can use NSDictionary, with key = NSDate and value = status (paid/pending). When you insert any date in the dictionary, check dictionary’s objectForKey: NSDate, if it returns nil, then you can insert the new date.