tags:

views:

45

answers:

2

I want to return nothing inside a function returning void. How would I do that?

A: 

i think sending a message to nil is a no-op

[nil message]

http://stackoverflow.com/questions/156395/sending-a-message-to-nil/160432#160432

John Boker
+3  A: 

You can do one of two things:

  1. Structure the flow of the code so that there is no need for a return statement.
  2. Place return; statements where you want the function to return control to the caller.

EDIT: To clarify, return; is a statement that returns control to the caller without yielding a value.

That's basically it.

LBushkin