Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/115.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_Ios_Xcode - Fatal编程技术网

Iphone 混乱的数组

Iphone 混乱的数组,iphone,ios,xcode,Iphone,Ios,Xcode,对iOS来说有点陌生,我也在学习Android。数组有点混乱 如何将其转换为iOS: 结果作为索引 nextresult[x]索引数组 for(x = 0; x < array.size; x++) { if(result < nextresult[x]) nextresult[x] -= 1; } (x=0;x

对iOS来说有点陌生,我也在学习Android。数组有点混乱

如何将其转换为iOS:

结果
作为索引

nextresult[x]
索引数组

for(x = 0; x < array.size; x++)
{
   if(result < nextresult[x])
         nextresult[x] -= 1; 
}
(x=0;x { 如果(结果
如果需要调整或不需要调整,它将检查数组的所有内容,

下面可能会告诉您一些想法- 正如您所提到的,我已经考虑过以下内容-
result'是值,
nextresult`是数组

for(x = 0; x < [array count]; x++)
{
   if(result < [nextresult objectAtIndex:x]) {
       [nextresult objectAtIndex:x] -= 1; 
    }
}

阅读苹果优秀的开发者文档

您可以在Xcode organizer中找到有关NSArray类的文档


我对你的问题投了否决票,因为只要看一下文档就可以很容易地解决这个问题。

如何基于button.tag创建NSMutableArray,它是这样保存的:NSUserDefaults*prefs=[NSUserDefaults standardUserDefaults];[prefs setInteger:1 forKey:@“Key”];
[yourArray addObject:[NSNumber numberWithInt:1]]; // Objective C array store objects. so we need to convert primitive data type into object.