开发者

objective c, NSMutableArray: indexOfObject

开发者 https://www.devze.com 2023-01-18 02:04 出处:网络
int k = 0; k = [myArrayindexOfObject:_endNode]; I only have a few objects added to the array and _endNode isn\'t one of them.
int k = 0;
k = [myArray  indexOfObject:_endNode];

I only have a few objects added to the array and _endNode isn't one of them.

I exp开发者_运维知识库ect my k value to be -1. But, my k on the second line gives me a value of 21787887.


It's actually NSNotFound, which is defined as NSIntegerMax.

This, by the way, is quite explicit in the documentation.


This information may help you,

I think there is no DATA in you _endNode so its returning the junk value for the "k"

Please check the values of _endNode.....


It's actually NSNotFound ans defined as NSIntegerMax


NSArray *array = [[NSArray arrayWithObject:_endNode] arrayByAddingObjectsFromArray:Myarray];
int k;
k=[array indexOfObject:_endNode];
0

精彩评论

暂无评论...
验证码 换一张
取 消