对于OS X 10.4.x和更低版本: int i; for (i = 0; i < [myArray count]; i++) { id myArrayElement = [myArray objectAtIndex:i]; ...do something useful with myArrayElement }对于OS X 10.5.x(或iPhone)及更高版本:for (id myArrayElement in myArray) { ...do something useful with myArrayElement}