Is there a way to access/store multiple arrays or data which could be compared against and return a value to ensure a program is faster?
I will have two variables with multiple possibilities I want to compare these two variables to all the possibilities and return a value but that will slow down the speed of the app is there a way to do it faster?
Sounds like you want to check for existence of an object within a set. Sets have a very fast look-up time but do not retain the order of the objects. They are particularly useful for checking whether a value is within a particular set of values. For example, the following snippet acquires a string of text from the user and ensures that it is either
@"Abc",@"Def", or@"Ghi". This trivial case involves only three elements but of course you can easily add more.NSSetobjects can contain anyNSObjectsubclass, includingNSString,NSNumber, etc. If you have a lot of elements in the set, consider storing them in a plist file (use an array), and use something like: