iphone - NSMutable Array object compare -


i want compare mutablearray object condition below...

array1 = 1,2,3,4; array2 = 2,1,4,3,6,7;

compare 2 array object & if object in array not add otherwise add in array3.

all array nsmutable array

please help

the easiest way using sets

nsmutableset *set = [nsmutableset setwitharray:array1]; [set addobjectsfromarray:array2];  nsarray *array = [set allobjects]; 

array give merged third array without duplicates.


Comments

Popular posts from this blog

c# - how to write client side events functions for the combobox items -

exception - Python, pyPdf OCR error: pyPdf.utils.PdfReadError: EOF marker not found -