NSObjectSafe icon indicating copy to clipboard operation
NSObjectSafe copied to clipboard

Swizzle commonly used function of Foundation container to prevent nil crash

Results 21 NSObjectSafe issues
Sort by recently updated
recently updated
newest added

https://github.com/jasenhuang/NSObjectSafe/blob/703982ea9f0797b0cbfd168c24d4d077fdacb2cc/NSObjectSafe/NSObjectSafe.m#L868 Setting

我添加进去之后,直接崩溃了。该设置的地方也都设置过了,不知道该怎么设置

这是一个能稳定复现的崩溃 从页面A 模态弹出 页面B(页面B中使用self.navigationItem.searchController = self.searchController 添加搜索栏) 此时使用该类库会稳定崩溃,打开僵尸对象,控制台打印*** -[UINavigationBar release]: message sent to deallocated instance 0x7fa305303970 若移除该类库则正常 若无法复现我可以上传demo

为什么不使用ARC?是否可以将release去掉变成ARC?

例如NSMutableData类别中[hookReplaceBytesInRange:withBytes:],如果有需要替换长度超过原数据长度的情况下,超过长度的数据就被截断,这样的做法容易产生意想不到的后果,希望能再被优化,不是简单地截断后面的数据,其实不截断处理也不会崩溃,不是吗?请尽快想办法优化,已经有开发者遇到此问题了 @jasenhuang @hypoyao @tedzhou

目前发现NSMutableArray的子类发生变化,区分了空内容和非空内容

需要把array的objectAtIndexedSubscript: 也加一个安全判断

1.进接引入头文件就可以了么 2.如果不报错了,bugly还能收集到错误不

Unknown class name 'NSAttributedStringKey'; did you mean 'NSAttributedString'?