I want to pull out a string from an array by index.
e.g array with object: @"Hello", @"World"
How to get @"World" from it? I use array[1], but it seems not work.
I want to pull out a string from an array by index.
e.g array with object: @"Hello", @"World"
How to get @"World" from it? I use array[1], but it seems not work.
I find this method works well:
- (id)objectAtIndex:(NSUInteger)index
You could also use an enumerator, like this:
NSEnumerator* enumerator = [myArray objectEnumerator];
ArrayObject* myObject;
while (myObject = [enumerator nextObject])
{
// do something with myObject
}