Maximum recursion depth in Objective-C
objective-c, recursion
Solution
There is no pre-set maximum recursion depth in Objective-C, or in most languages.
Furthermore a simple test where you recurse and count the times till you fault does not give you a realistic answer either, it will probably over-estimate the depth you can reach in a real program.
You can keep calling as long as there is sufficient space on the stack for the frame of the method/function you are calling. The frame includes various housekeeping information (usually fixed size), save registers (variable size) and the method/function's local variables (variable size) - so there is no single frame size.
If you want a rough approximation you could declare a function with the average number & types of local variables that occur in your code and count how many times you can recursively call it. That will give you an approximation for the machine you're running on.
Mac OS X itself imposes an upper limit to the stack size, you can find this for your kernel using `ulimit -s`. Also see this Apple doc
Problem
What is the maximum recursion depth limitation of Objective-C ?