iOS_Bug收集(一)

这篇博客汇总了iOS开发中遇到的一些典型错误,包括数据问题(如空值、越界、类型匹配错误)、tableView问题(如dataSource设置、cell复用、行数更新错误)以及UIActionSheet的问题(如按钮标题缺失)。同时提到了多线程、模态过渡和约束布局等其他问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >


Bug收集


1、数据问题 (空值,越界, 数据类型不对等问题)

(1)   *** -[__NSPlaceholderDictionary initWithObjects:forKeys:count:]: attempt to insert nil object from objects[0] 

这个问题都是字典或数组空值引起的



(2)  -[NSNull boolValue]: unrecognized selector sent to instance 0x1a0663490


(3)  -[__NSCFArray objectForKey:]: unrecognized selector sent to instance 0x136b1a500

NSArray 不能调用 NSDictionary的方法


(4)  -[__NSDictionaryI intValue]: unrecognized selector sent to instance 0x10f9ae370

服务器返回数据要做类型判断,空值判断,不能完全依赖服务器。



(5)  *** -[NSPlaceholderString initWithString:]: nil argument 

参数为空, 要加判断



(6)  *** Collection <__NSArrayM: 0x12de8c2b0> was mutated while being enumerated.

数组遍历过程不可进行增删操作, (同一列表两个接口,异步请求导致此问题)



(7)  *** -[__NSCFConstantString substringToIndex:]: Index 18446744073709551615 out of bounds; string length 0

越界问题



(8)  -[__NSCFConstantString name]: unrecognized selector sent to instance 0x10ff33c90

(9)  -[NSPathStore2 image]: unrecognized selector sent to instance 0x18405e50

(10)  -[__NSSingleObjectArrayI deletePostAuth]: unrecognized selector sent to instance 0x170012b70 (WPForumPortal + 2621328)

方法不对应



[<__NSArrayI 0x17ec0020> valueForUndefinedKey:]: this class is not key value coding-compliant for the key gaussianBlur.

毛玻璃效果方法,系统版本问题



[ setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key WECount. 




_______________________________

2、tableView问题

(1)  UITableView dataSource must return a cell from tableView:cellForRowAtIndexPath:



(2)  UITableView dataSource is not set (WPForumPortal + 6399720)



(3)  unable to dequeue a cell with identifier cellid - must register a nib or a class for the identifier or connect a prototype cell in a storyboard



(4)  -[WFLoginNoticeCell setIsMarkHidden:]: unrecognized selector sent to instance 0x16173a80

 cell类型强转后,cell属性不可用, 



(5)  Invalid update: invalid number of rows in section 0. The number of rows contained in an existing section after the update (4) must be equal to the number of rows contained in that section before the update (2), plus or minus the number of rows inserted or deleted from that section (1 inserted, 1 deleted) and plus or minus the number of rows moved into or out of that section (0 moved in, 0 moved out). 

添加,删除tableview一行时报错, reloadRowsAtIndexPaths: deleteRowsAtIndexPaths

更新前后的行数要相等,



_________________________________

3、UIActionSheet问题

(1)  UIActionSheet: Buttons added must have a title.

addButtonWithTitle:  (title不能为空)





_________________________________


Signal 11 was raised. SIGSEGV (WPForumPortal + 10685333)




Only run on the main thread!




Attempting to begin a modal transition from to while a transition is already in progress. Wait for viewDidAppear/viewDidDisappear to know the current transition has completed



Constraint improperly relates anchors of incompatible types: (-[MASViewConstraint install] + 844)


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值