我的工作在SQLite和我寫了一個查詢返回了我兩個數組ItemsArray和CustomersIDArray爲:如何在數組中查找重複值?
ItemsArray
Element at Index 0 = Off White,
Element at Index 1 = Fan,
Element at Index 2 = Off White,
Element at Index 3 = Delux,
Element at Index 4 = Fan
CustomerIDArray
Element at Index 0 = 1,
Element at Index 1 = 2,
Element at Index 2 = 2,
Element at Index 3 = 3,
Element at Index 4 = 4
我想造成這樣的米白色= 2(算),範= 2(計數)和Delux = 1; 和合成陣列,
Result Array
Element at Index 0 = Off White,
Element at Index 1 = Fan,
Element at Index 2 = Delux
其實我想重複的第一陣列計數,但該值不能同爲CustomerArray。 請幫助我完成邏輯或代碼。
試試這個問題提供的解決方案:(http://stackoverflow.com/questions/6841072/how-to-count-duplicates-values-in-nsarray) – iNoob 2012-04-23 12:39:25
@INoob親愛的我不知道如何使用NSCountedSet ..你能告訴我嗎? – 2012-04-23 12:45:12
試試這裏的答案:http://stackoverflow.com/a/7606138/876283 – iNoob 2012-04-23 12:50:36