Skip to content

The Top 5 Crashes on iOS

apteligent.com
20 pointsandrewmlevy1 comment
On HN

Comments

The first example’s remedy seems to be wrong.

I am not aware of any reason to test for "nil" in Objective-C, as that remedy suggests. Sending the "doSomething" message to "nil" should do nothing.

If SIGSEGV does occur for an object, it is probably for the exact opposite reason: you have a pointer that is NOT "nil" but it refers to something that has been freed. (Or, the SIGSEGV is not related to objects at all, and is caused by some other access such as plain C code.)

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.