0
我對數據庫中的其中有索引2NSRangeException:「超越界限」錯誤
在此我不保存任何數據,但現場一個基於SQLite的應用程序的工作,當我運行數據庫在Firefox上我看到,該指數2有一個值-2147483648,當我試圖在我的子視圖添加新的細胞:
return [appDelegate.items count]+1;
我收到此錯誤:
Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[NSCFArray objectAtIndex:]: index (2) beyond bounds (2)'
的在索引2變量是十進制類型: -
NSInteger n = i.need;
和...
sqlite3_bind_int(updStmt, 2, n);
...是默認值指數2即將在今年是否有做的例外什麼嗎?如果是,我該如何糾正,如果沒有,那麼爲什麼會發生?
'return [appDelegate.items count] +1;',其中的方法是什麼?如果數組中有兩個項目,則無法訪問索引2.您只能訪問索引0或1。 – Sam 2013-08-07 14:21:25