To create an Array with the name testArray do the following:
NSArray *testArray = [[NSArray alloc] init];
The Array called an empty array.
Add something to the array
[testArray addObject:someObject];
[testArray addObject:someOtherObject];
// Get stuff out of the array
NSObject *anObject = [testArray objectAtIndex:0];
// Loop through contents of array
for (NSObject *anObject in testArray) {
}
// Remove from array
[testArray removeObjectAtIndex:1];
No comments:
Post a Comment