문제

I have 7 float values shorted in NSMutableArray, i need to find the shortest value in between them, how do i find that shortest value

도움이 되었습니까?

해결책

Maybe something like this will work:

int k = [yourArray objectAtIndex:0];
for (unsigned i = 1; i < [yourArray count]; i++){
    if([yourArray objectAtIndex:i] < k) k = [yourArray objectAtIndex:i];
}
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top