Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/iphone/43.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Iphone 如何初始化数组值';将其插入另一个新阵列_Iphone - Fatal编程技术网

Iphone 如何初始化数组值';将其插入另一个新阵列

Iphone 如何初始化数组值';将其插入另一个新阵列,iphone,Iphone,我有数组距离列表数组。。5公里,10公里,15公里,20公里,25公里。 distanceListArray属于appDelegate.class 距离数组计数为5 现在我有了另一个数组 其中包含事件数据列表 eventListArray属于DistanceClass 调用eventListArray。对于5公里,its显示10个事件,对于10公里,its显示20个事件 现在我需要将每个部分的数据从eventListArray的distanceListArray加载到另一个新数组中 所有阵列都是

我有数组距离列表数组。。5公里,10公里,15公里,20公里,25公里。 distanceListArray属于appDelegate.class

距离数组计数为5

现在我有了另一个数组

其中包含事件数据列表

eventListArray属于DistanceClass

调用eventListArray。对于5公里,its显示10个事件,对于10公里,its显示20个事件

现在我需要将每个部分的数据从eventListArray的distanceListArray加载到另一个新数组中

所有阵列都是NSMutableArray

我希望这会造成歧义


请帮帮我。我找到了解决办法。它起作用了,但我不知道在我的搜索中我会在哪里被击中

newArray = [[NSMutableArray alloc] init];
for (int i=0; i<=4; i++) {
    for (EventInfo *string in [[appDelegate.distanceListArray objectAtIndex:i] eventListArray]) {
        NSLog(@"String is %@",string.event_Title);
        [newArray addObject:string];
    }
}
newArray=[[NSMutableArray alloc]init];

对于(inti=0;我对此有点谨慎:“我希望这会造成歧义。”;)我实际上不确定将部分加载到其他部分是什么意思。您能更清楚地了解一下数据的外观,以及您希望得到的格式吗?实际上,我正在为我的tableview搜索选项。在这里,我根据显示事件的部分显示数据。。现在我需要搜索这个上下文。我的意思是。。标题'在此代码中。。。我有个问题。。。当objectAtIndex:计数变为1、2、3、4、5。。。。。。我很珍惜。递增的第二个对象eventListArray没有它的空。。。它让我崩溃。。。有人能帮我吗?是的,当然,为什么不使用
newArray=[appDelegate.distanceListArray mutableCopy]?请尝试使用
newArray=[appDelegate.distanceListArray mutableCopy]
而不是
for
循环。希望这对你有帮助。