ios - NSNotFound 比较不起作用
<p><div>
<aside class="s-notice s-notice__info post-notice js-post-notice mb16"role="status">
<div class="d-flex fd-column fw-nowrap">
<div class="d-flex fw-nowrap">
<div class="flex--item wmn0 fl1 lh-lg">
<div class="flex--item fl1 lh-lg">
<b>已结束。</b>此问题是 <a href="https://stackoverflow.com/help/closed-questions" rel="noreferrer noopener nofollow">not reproducible or was caused by typos</a> .它目前不接受答案。
<br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
<p><p>2147483647 <em>是</em> NSNotFound(在某些情况下也称为-1)。您测试测试成功或失败的方式有问题,因为 Cocoa 本身的行为与宣传的完全一样。</p>
<pre><code>NSInteger indexOfCell = [ indexOfObject:@""];
NSLog(@"%d", indexOfCell); // some number
NSLog(@"%d", NSNotFound); // the same number
NSLog(@"%d", indexOfCell == NSNotFound); // 1, i.e. YES
</code></pre>
<p>自己试试吧。</p></p>
<p style="font-size: 20px;">关于ios - NSNotFound 比较不起作用,我们在Stack Overflow上找到一个类似的问题:
<a href="https://stackoverflow.com/questions/21321067/" rel="noreferrer noopener nofollow" style="color: red;">
https://stackoverflow.com/questions/21321067/
</a>
</p>
页:
[1]