Form + Code example - Thread 1: EXC_BAD_ACCESS (code=1, address=0x0)

I’m looking at an example code from the book Form + Code and I am getting this error and am unable to run the application.

The issue is shown in the screenshot below

Hi NeoSchO,

In the console, it says that the image isn’t loaded.
Therefore, accessing the pixel (0,0) will throw an error.

pixels[(int)(i*WIDTH + j)]

is empty.

Check inside bin/data that you have the image “nasa-iceberg.jpg”.

Or look into this img loader example.

Hope this helps.

++

P

This was as simple as a misspelling of iceberg. One of my downfalls.

Should have checked it over thoroughly.

Thank you for your help!