// NSMutableArray
// alloc init
// addObject
// for each
NSMutableArray *myArray = [[NSMutableArray alloc] init];
[myArray addObject:@"First line"];
[myArray addObject:@"Second line"];
[myArray addObject:@"Third line"];
[myArray addObject:@"Fourth line"];
[myArray addObject:@"Fifth line"];
for (NSString *line in myArray) {
NSLog(@"line: %@", line);
}
沒有留言:
張貼留言