I am trying to get the compare an object in an NSArray with two objects in two different NSArrays and i want to store the first occurence of the object and discard the next.
e.g:-
I have an Array1 where it contains objects like (20.12, 20.15, 21.4, 22.6, 23.0, 24.2, 28.7, 30.5, 30.9, 32.6, 33.7). Now i have another Array2 that contains objects like (20.00, 22.0, 28.0, 30.0, 33.0) and another Array3 that contains objects like (21.0, 24.0, 29.0, 32.0, 34.0)
Now i want to store the first objects that are in between (20.00 - 21.0, 22.0 - 24.0, 28.0 - 29.0, 30.0 - 32.0, 33.0 - 34.0). I have tried to implement this by using
if (clickTimeInterval >= [[Array2 objectAtIndex:i] doubleValue] && clickTimeInterval <= [[Array3 objectAtIndex:i] doubleValue]) {
My clickTimeInterval is the time interval stored in my Array1. I am able to get the values but i just want to store the values that comes first and store into Array4. It looks something like Array4 = (20.12, 22.6, 24.2, 28.7, 30.5, 33.7). Can anyone please help me out on how to get this?