I'm new to using blocks, and they really seem like a great alternative to delegate methods. I implemented a simple block to do some simple math after watching a few tutorials, but I'm really struggling in being able to get them to do much more than that thanks to their wacky syntax.
Could someone help explain how I'd implement a block in objective-c that would do something similar to the pseudo code below?
- Call block from within a method
- The block looks at a class array and notifies the caller if it is populated (has a count of > 0)
- If the array's count is 0, the block will notify the caller when it has something added to it and the block will then stop
Thanks!