How can I store a float value in an NSArray?

前端 未结 2 804
小蘑菇
小蘑菇 2021-01-12 05:13
for ( tempI = 0; tempI < 10; tempI++ )  
{
    tempJ = 1;
    NSArray *objectsForArray = [NSArray arrayWithObjects:@\"array[tempI][tempJ]\", @\"array[tempI][tempJ         


        
2条回答
  •  北荒
    北荒 (楼主)
    2021-01-12 05:50

    Try:

    for ( int tempI = 0; tempI < 10; tempI++ )  
    {
        int tempJ = 1;
        fl_tempI = float(tempI);
        NSArray *objectsForArray = [NSArray arrayWithObjects:@"array[fl_tempI][tempJ]", @"array[fl_tempI][tempJ+1]",  @"array[fl_tempI][tempJ+2]", nil];
    }
    

提交回复
热议问题