How to create an array of CGPoints by pairing values from two different NSArrays in objective-c?
Lets say I have an Array “A” with the values: 0, 1, 2, 3, 4
And I also have an Array “B” with the values: 21, 30, 33, 35, 31
I would like to create Array “AB” with CGPoint values: (0,21), (1,30), (2,33), (3,35), (4,31)
Thanks for your help.
Note that Objective-C collection classes can only hold objects, so I have assumed your input numbers are held in
NSNumberobjects. This also means that theCGPointstructs must be held in aNSValueobject in the combined array: