我有这个...
allTableData = [[NSMutableArray alloc] initWithObjects:
[[Food alloc] initWithName:@"1" andDescription:@"Hi man!"],
[[Food alloc] initWithName:@"2" andDescription:@"Hi woman"],
nil ];
我怎么能做这样的事情?
NSArray *array = [NSArray arrayWithObjects:@"Hi man",@"Hi woman",nil];
allTableData = [[NSMutableArray alloc] initWithObjects
for(i=0; i<2; i++)
{
NSString *aString = [NSString stringWithFormat:@"%d", i];
[[Food alloc] initWithName:aString andDescription:@"array[i]"];
}
...以及通过一个循环进入?