Objective C - Manual Array FIFO Queue

后端 未结 2 1992
执念已碎
执念已碎 2021-02-11 02:15

Just wondering the best way to create a manual array, without using NSMutalbleArray, I have being researching best possible solutions but without an elegant answer, what do you

2条回答
  •  别跟我提以往
    2021-02-11 02:23

    Array with FIFO manner:

    if (mutArr.count == 5) {
            for (int j = 0; j < 4; j++) {
                [mutArr exchangeObjectAtIndex:j withObjectAtIndex:j+1];
            }
            [mutArr removeObjectAtIndex:4];
            [mutArr addObject:mutDict];
        }else{
            [mutArr addObject:mutDict];
        }
    

提交回复
热议问题