Actually, the task is executing just fine and exiting with an indication of success by returning a status of 0. When you echo the result in the terminal, is it 0?
From a comment on your question:
this is from my gdb, after the lines
of code above were executed: (gdb) po
status Cannot access memory at address
0x0 – demonslayer319
An int
is not an object; thus, po status
won't work. po
works by sending -description
to the object, but it does so in a slightly different fashion than just a plain old objc_msgSend()
call. Thus, when gdb tries to treat the value 0 as an object's address, gdb detects that it can't possibly be valid because 0
as an address can't be dereferenced.
Try p status
instead.
(And, yes, it could be possible that the task is nil -- that you didn't correctly create the task in the first place -- and, thus, nil-eats-message causes status to be 0)