简单的数组循环问题Objective-C

Emi*_*mil 2 arrays iphone xcode loops objective-c

你怎么能做这个工作?

numbers = [[NSMutableArray alloc] initWithObjects: ({int x = 0; while (x <= 60 ) { return x; x++; } })];
Run Code Online (Sandbox Code Playgroud)

谢谢 :)

Dav*_*ong 9

NSMutableArray * array = [[NSMutableArray alloc] init];

for (int i = 0; i <= 60; ++i) {
  [array addObject:[NSNumber numberWithInt:i]];
}
Run Code Online (Sandbox Code Playgroud)