国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 系統 > iOS > 正文

searchDisplayController 引起的數組越界處理辦法

2019-10-21 18:57:38
字體:
來源:轉載
供稿:網友
這篇文章主要介紹了searchDisplayController 引起的數組越界處理辦法,需要的朋友可以參考下
 

下面把searchDisplayController 引起的數組越界處理辦法給大家分享如下:

當[searchDisplayController.searchResultsTableView setSeparatorStyle:UITableViewCellSeparatorStyleNone] 時,發送了崩潰

錯誤提示如下:

Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[__NSArrayI objectAtIndex:]: index 1 beyond bounds [0 .. 0]'*** First throw call stack:(0  CoreFoundation           0x000000010c6c6c65 __exceptionPreprocess + 1651  libobjc.A.dylib           0x000000010c35fbb7 objc_exception_throw + 452  CoreFoundation           0x000000010c5bd17e -[__NSArrayI objectAtIndex:] + 1903  UIKit                0x000000010d230fd2 -[UITableViewDataSource tableView:indentationLevelForRowAtIndexPath:] + 1064  UIKit                0x000000010cdfb1b9 __53-[UITableView _configureCellForDisplay:forIndexPath:]_block_invoke + 1711

查了好久才查到原因: 在錯誤log中有提示

3  UIKit                0x000000010d230fd2 -[UITableViewDataSource tableView:indentationLevelForRowAtIndexPath:] + 106解決方法:-(NSInteger)tableView:(UITableView *)tableView indentationLevelForRowAtIndexPath:(NSIndexPath *)indexPath{  return 0;}

以上代碼就是針對searchDisplayController 引起的數組越界處理辦法的解決方案,希望對大家有所幫助。



注:相關教程知識閱讀請移步到IOS開發頻道。
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 礼泉县| 宁都县| 新乐市| 广宗县| 尼木县| 鹤岗市| 保靖县| 东辽县| 沁阳市| 泸定县| 兰溪市| 赫章县| 东光县| 佛冈县| 左权县| 光山县| 岚皋县| 托克逊县| 苍南县| 邵东县| 邵东县| 静安区| 宾阳县| 遂川县| 孙吴县| 富裕县| 台安县| 策勒县| 华蓥市| 盘锦市| 白朗县| 凌海市| 茌平县| 黄陵县| 沾化县| 武平县| 永安市| 濉溪县| 嘉荫县| 梅河口市| 潜山县|