In fact there’s nothing iOS specific about using lists and arrays in Objective-C, although I guess most people see no reason to use Objective-C just for the fun of it. However if you like, you can install the Objective-C frontend of the GNU Compiler GCC on almost every platform that exists. To make use of the array classes you have to install the Foundation library from the GNUstep, too.
Anyway, there are two classes that implement what other languages know as arrays, lists: NSArray and NSMutableArray. While you can’t change an NSArray after initialization, you can add and remove elements from and to a NSMutableArray. An NSMutableArray gets initialized with:
found_words = [NSMutableArray array];
Beware, that when you are using alloc here, you have to take care to release the array, when you are done using it. The following method adds an item to the array:
[found_words addObject:someword];
while [found_words objectAtIndex:index] returns the item at the index. [found_words removeAllObjects] empties the array. If you already have a non-mutable array that you want to copy to an NSMutableArray, there’s the method mutableCopy you can use.
There are some helper classes for creating arrays or hashes from strings, too. When you want to create an array from a comma-separated string, you can use:
myMutableArray = [[someString componentsSeparatedByString:@“,”] mutableCopy];