gpt4 book ai didi

iphone - 获取 -[__NSArrayI addObjectsFromArray :]: unrecognized selector sent to instance 0xa0c5f70 error

转载 作者:塔克拉玛干 更新时间:2023-11-02 08:53:20 26 4
gpt4 key购买 nike

我在数组中添加对象时出错-[__NSArrayI addObjectsFromArray:]: 无法识别的选择器发送到实例 0xa0c5f70

id max;
NSMutableArray * MovePointsArray=[[NSMutableArray alloc]init];
max=[pointsArray objectAtIndex:0];
for(int i=0;i<[pointsArray count];i++){

if ([pointsArray objectAtIndex:i] > max) {
max=[pointsArray objectAtIndex:i];
[MovePointsArray addObject:max];
}

}

NSMutableArray * pointArray =[NSArray arrayWithObjects: [pointsArray objectAtIndex:0],[pointsArray lastObject], nil];
[pointArray addObjectsFromArray:MovePointsArray];

不知道我做错了什么。

最佳答案

最后一行

NSMutableArray * pointArray =[NSArray arrayWithObjects: [pointsArray objectAtIndex:0],[pointsArray lastObject], nil];

NSArray 替换为 NSMutableArray

谢谢,

关于iphone - 获取 -[__NSArrayI addObjectsFromArray :]: unrecognized selector sent to instance 0xa0c5f70 error,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16163081/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com