ESPN Interview Question: Design a block function that ... | Glassdoor

Interview Question

Mobile Software Engineer Interview Bristol, CT

Design a block function that returns an array and Bool.


Interview Answer

1 Answer


Blocks are a relatively recent introduction (2010?) to the world of Objective C. Like declared functions in most other languages, a block function can only return one "thing" (or object). To get both an array and BOOL out of a block, you can either declare "__block" variables that can be passed in and modified from within the block, or you can return some Objective C object that contains both the array and BOOL.

Interview Candidate on Jan 24, 2013

Add Answers or Comments

To comment on this, Sign In or Sign Up.