How did I crash in a @try/@catch block?

半城伤御伤魂 提交于 2019-12-06 13:29:41

This is a segmentation fault (SIGSEGV), not an exception.

Those faults aren't exceptions, meaning you can't use a try/catch block.

A segmentation fault means you are trying to access a memory region that doesn't belong to your app.

In your case, it may be cause be auto-released objects that gets deallocated, and then accessed (the pointer is not valid anymore, since the object was deallocated).

Ensure your htmlString variable is still pointing to a valid object...

By the way, I don't think calling setNeedsDisplay is needed after using loadHTMLString.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!